Export to XLS

Stimulsoft Reports.NET discussion
Post Reply
NicolasM
Posts: 23
Joined: Tue Mar 08, 2016 1:53 pm

Export to XLS

Post by NicolasM »

Hi,

I need your help again for a new export!

I want to export BO data (C#) to XLS file, by using the same MRT model than for print.

My first problem must be into my MRT file. I have empty lines between 2 lines. If I take a look in the print preview window, I can see these lines too. Is there a problem with my MRT file? I attach CSV and MRT file.

My second problem is the big space between my table and the footer in the CSV file. Can I change that without change anything when try to print?

Thanks in advance for any help!
Nicolas
Attachments
StatReport.mrt
(85.51 KiB) Downloaded 455 times
toto.xls
(118 KiB) Downloaded 347 times
NicolasM
Posts: 23
Joined: Tue Mar 08, 2016 1:53 pm

Re: Export to XLS

Post by NicolasM »

Hi,

I try to export to XLS file your "Simple Table" example with your "Demo" project. I add following code before "report.Design();" in the "btDesign_Click" (StiDemoForm.cs):

Code: Select all

            // Get filepath
            string filepath = GetFilePath("XLS File|*.xls");
            if (filepath != "")
            {
                 StiExcelExportSettings settings = new StiExcelExportSettings();
                 settings.UseOnePageHeaderAndFooter = true;

                 // Export document
                 report.ExportDocument(StiExportFormat.Excel, filepath, settings);

                 // Open document
                 System.Diagnostics.Process.Start(filepath);
            }
I doing this to test XLS export and see if empty lines was added. But with this code, XLS file cannont be open, Excel says the file is corrupted. Is there a problem with Table on export?

Thanks in advance for any help,
Nicolas
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Export to XLS

Post by HighAley »

Hello, Nicolas.

Sorry, but we can't reproduce your issue with additional lines in Excel without data.
Please, send us sample data for your report.

If you need to remove empty space you should rebuild the report. Do you need to print the Footer on the bottom of the page?

Thank you.
NicolasM
Posts: 23
Joined: Tue Mar 08, 2016 1:53 pm

Re: Export to XLS

Post by NicolasM »

Hello HighAley,

Thank you for your answer!

I will send you a external project with data next monday (I'm not at office today). But can you reproduce the export problem on your "Demo" project?

Rebuild the report? Well, I just build it but I will try this. For the Footer, is it possible to don't print it? Can you tell me how, please?

Thank you,
Nicolas
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Export to XLS

Post by HighAley »

Hello, Nicolas.

Our product is designed to show, print and export the reports as is.
The main target of our product to print and export exactly the same that you see in the Viewer.
If you need to get different report on printing and exporting, it should be different reports.

But there are some features that can help you. There is a Printable property of all components that you could set to False and the component will not be printed.
The position of all rest components be the same as in Viewer.

Also it possible to use the Printing and Exporting events of the report where you could change the report as you need.
You could write code there that will change the report or event load the different report template, render it and pass it further.

We are waiting for a sample that will help us to reproduce the issue with extra lines in Excel.

Thank you.
NicolasM
Posts: 23
Joined: Tue Mar 08, 2016 1:53 pm

Re: Export to XLS

Post by NicolasM »

Hello HighAley,

Thank you for this information. It's will be very useful for me!

I start working on a new software to show you my problem with Excel. When finished, I send it by email to Stimulsoft Support Team.

Thank you,
Nicolas
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Export to XLS

Post by Alex K. »

Hello,

Ok.
Please let us know if you need any additional help.

Thank you.
Post Reply