Export to .rtf

Stimulsoft Reports.NET discussion
Post Reply
bakidost
Posts: 8
Joined: Mon May 14, 2007 7:02 am
Location: Turkey

Export to .rtf

Post by bakidost »

Hi,

We are using StimulReport .NET 2007.1 Trial version. We have faced with some problems.

1. While exporting the report in xls, rtf, and html formats, the links in the table of contents part does not work. Also, the report appears in a tabular form. Is this a problem in the trial version, or can't I have a proper report in .doc format?

2. While retrieving images from the database (using the URL of the images), it does not retrieve all of the images I want, although the URLs are correct.

3. Is it possible to have unlimited page size during design time, and have A4 pages at run time?

4. The header appears on every page that the data of the header continues. Is it possible to write the header once?

If I am not clear, let me know.
Any ideas are appreciated.
Thanks in advance.
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

Export to .rtf

Post by Edward »

bakidost wrote:1. While exporting the report in xls, rtf, and html formats, the links in the table of contents part does not work.
This ability works now for export in Pdf only.
bakidost wrote:Also, the report appears in a tabular form. Is this a problem in the trial version, or can't I have a proper report in .doc format?
Please see the report.ExportDocument method. There you can set additional parameters for the export.
For the HTML export you may use Span mode of the export, for the Rtf - Frame mode. These parameters may be set as in the export parameters window as in the settings parameter of the ExportDocument method.
bakidost wrote:2. While retrieving images from the database (using the URL of the images), it does not retrieve all of the images I want, although the URLs are correct.
Please describe this in more details.
bakidost wrote:3. Is it possible to have unlimited page size during design time, and have A4 pages at run time?
1. You need to set LargeHeight in true.
2. LargeHeightFactor property sets the number of times in which the Height of the page in the design time will be increased.
This mode doesn't affect to runtime.
bakidost wrote:4. The header appears on every page that the data of the header continues. Is it possible to write the header once?
Please set PrintOnAllPages property in false.
bakidost
Posts: 8
Joined: Mon May 14, 2007 7:02 am
Location: Turkey

Export to .rtf

Post by bakidost »

Thank you for your quick reply.

I have a problem while I was trying to export the report in HTMLSpan mode. The images appear in the viewer, but they do not appear in the report in HTMLSpan mode. I saved the report with .html extension, can the problem arise due to that?

2. While retrieving images from the database (using the URL of the images), it does not retrieve all of the images I want, although the URLs are correct.

I am using SQL Server as the database and connect to the database inside the designer. I have drag and drop of database fields to the report, and there is no problem in the text part. I also dragged images to the report. I used Image URL, and the Image URL is the database field {Image.URL}. I have a databand X, and I used it as master component of the image databand. Here, for some groups, it retrieves the images, and for some of them it does not retrieve. What can be the problem? Is the database refreshed each time the report is compiled?
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

Export to .rtf

Post by Edward »

bakidost wrote:I have a problem while I was trying to export the report in HTMLSpan mode. The images appear in the viewer, but they do not appear in the report in HTMLSpan mode. I saved the report with .html extension, can the problem arise due to that?
You need to create image host for saving images, if needed we can provide a sample code for this. The best way is to save into mht file format.
bakidost wrote:2. While retrieving images from the database (using the URL of the images), it does not retrieve all of the images I want, although the URLs are correct.

I am using SQL Server as the database and connect to the database inside the designer. I have drag and drop of database fields to the report, and there is no problem in the text part. I also dragged images to the report. I used Image URL, and the Image URL is the database field {Image.URL}. I have a databand X, and I used it as master component of the image databand. Here, for some groups, it retrieves the images, and for some of them it does not retrieve. What can be the problem? Is the database refreshed each time the report is compiled?
Please send to Image mrt file of your report (you can save to this format via third button from the left in the Designer) and also mdc file (the same button in the StiWebViewer preview).

Thank you.
bakidost
Posts: 8
Joined: Mon May 14, 2007 7:02 am
Location: Turkey

Export to .rtf

Post by bakidost »

If you can provide a sample code for the image host, it will be very fine.

I have solved retrieving images problem by setting "PrintIfDetailEmpty = true".

Now, I have some other problems.

1. I have Databand1 whose source is Student. Databand2 & Databand3's master band is DataBand1.

Databand1 - Student
Databand2 - Personal Information
Databand3 - Courses

And I want to create a table of content, that is consisting of
Jack Moliere ....................................................1
Jack Moliere's Personal Information....................1
Jack Moliere's Courses......................................2

Jane Eyre........................................................2
Jane Eyre's Personal Information ......................2
Jane Eyre's Courses ........................................0

Here, Jane Eyre's page number is 0, this is because she has not an entry in the courses table, and does not actually appear in the report, but it is appearing in the TOC. How can I avoid this situation? That is, if the detail is empty, I do not want it to be seen in the TOC.


2. Is there a table template in StimulReport? I want to create a table as below, so cross-tabs do not seem to be convenient.

StudentName-------- BirthDay ------------ BirthPlace

John Lock ------------ 1.1.2007 ------------- London
Kevser Sonmez ----- 17.06.2007 ----------- Ankara

Now, I am creating a table by simply dragging text fields and bordering them. But, when I save the report .rtf or .doc format, some fields do not fit into the cell, although they are seemed to be fitting in the viewer. How can I handle these problems?


Thank you in advance..

Vital
Posts: 1278
Joined: Fri Jun 09, 2006 4:04 am

Export to .rtf

Post by Vital »

If you can provide a sample code for the image host, it will be very fine.
Please see following code:

Code: Select all

public class StiWebImageHost : StiHtmlImageHost
	{
		public override string GetImageString(Bitmap bmp)
		{
			Guid imageGuid = Guid.NewGuid();
			
			MemoryStream imageStream = new MemoryStream();
			bmp.Save(imageStream, webViewer.ImageFormat);

			webViewer.Page.Cache.Add(imageGuid.ToString(), imageStream.ToArray(), null, Cache.NoAbsoluteExpiration, 
				webViewer.ServerTimeOut, System.Web.Caching.CacheItemPriority.Low, null);

			string url = null;
            string query = null;

			if (webViewer.Page.Request.UrlReferrer != null)
            {
                url = webViewer.Page.Request.UrlReferrer.AbsolutePath;
                query = webViewer.Page.Request.UrlReferrer.Query;
            }
			else 
            {
                url = webViewer.Page.Request.Url.AbsolutePath;
                query = webViewer.Page.Request.Url.Query;
            }

            if (query != null && query.Length > 0)
            {
                return string.Format("{0}{1}&stimulreport_image={2}", url, query, imageGuid);
            }
            else
            {
                return string.Format("{0}?stimulreport_image={1}", url, imageGuid);
            }
		}

		private StiWebViewer webViewer = null;

		public StiWebImageHost(StiWebViewer webViewer) : base (null)
		{
			this.webViewer = webViewer;
		}
	}
This is standard web image host. Because html can't contain images you need store it to some place. This class store images in page cache and return url to this image. You can save your images on web server.

1. I have Databand1 whose source is Student. Databand2 & Databand3's master band is DataBand1.

Databand1 - Student
Databand2 - Personal Information
Databand3 - Courses

And I want to create a table of content, that is consisting of
Jack Moliere ....................................................1
Jack Moliere's Personal Information....................1
Jack Moliere's Courses......................................2

Jane Eyre........................................................2
Jane Eyre's Personal Information ......................2
Jane Eyre's Courses ........................................0

Here, Jane Eyre's page number is 0, this is because she has not an entry in the courses table, and does not actually appear in the report, but it is appearing in the TOC. How can I avoid this situation? That is, if the detail is empty, I do not want it to be seen in the TOC.
Please see sample report Anchors in category navigation of Demo application. This report used special anchors. To output page number in TOC we use following expression:

Code: Select all

{GetAnchorPageNumber(component.TagValue)}
In your case you can use following code:

Code: Select all

{GetAnchorPageNumber(component.TagValue)==0?"-":GetAnchorPageNumber(component.TagValue).ToString()}
Instead "0" we output "-".
[/quote]
Vital
Posts: 1278
Joined: Fri Jun 09, 2006 4:04 am

Export to .rtf

Post by Vital »

bakidost wrote: 2. Is there a table template in StimulReport? I want to create a table as below, so cross-tabs do not seem to be convenient.

StudentName-------- BirthDay ------------ BirthPlace

John Lock ------------ 1.1.2007 ------------- London
Kevser Sonmez ----- 17.06.2007 ----------- Ankara

Now, I am creating a table by simply dragging text fields and bordering them. But, when I save the report .rtf or .doc format, some fields do not fit into the cell, although they are seemed to be fitting in the viewer. How can I handle these problems?
We will post you tomorrow special instructions for creating reports which will be export as table.

Thank you.
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

Export to .rtf

Post by Edward »

Read the following instruction on creating reports with table structure, please. Following the principles from this guide will cause to getting the reports with correct table structure. All unnecessary cells will never occur again!

http://forum.stimulsoft.com/upload/MSExcelExport.zip

Thank you.
Post Reply