Iron Speed Technical Forums
Register Latest Topics
 
 
 


Reply
  Author   Comment  
jimatqsi

Registered:
Posts: 62
Reply with quote  #1 
I'd like to run a script file to modify the Excel file Ironspeed is creating. My users are fed up with seeing heading type stuff in every row in the spreadsheet. For instance, a price sheet for a customer shows the customer number and name on every row, along with the SKU and price. I want to run a script that will place the Customer number and name (or whatever fields are appropriate, at the top of a new worksheet and then transfer the rows of SKU and price to the new sheet below the Customer name and number. 

The script has to run on the server, not the client. But to do this I have to find know where the Excel file is stored after it is created, before it is downloaded. 

Any ideas?

Thanks,

Jim
JimiJ

Avatar / Picture

MVP Developer
Registered:
Posts: 1,954
Reply with quote  #2 
Hi Jim,

I am not sure of the outcome of your intention. However, we successfully exported well-designed Excel report using RenderReport method of Telerik's ReportProcessor:   

The code will look something like this(ref:http://www.telerik.com/forums/programmatically-exporting-report-to-excel-directly-from-web-app):

void ExportReport(Telerik.Reporting.Report reportToExport)
       {
           Telerik.Reporting.InstanceReportSource instanceReportSource = new Telerik.Reporting.InstanceReportSource();
           instanceReportSource.ReportDocument = reportToExport;
           ReportProcessor reportProcessor = new ReportProcessor();
           RenderingResult result = reportProcessor.RenderReport("XLSX", instanceReportSource, null);
 
           string fileName = result.DocumentName + "." + result.Extension;
 
           Response.Clear();
           Response.ContentType = result.MimeType;
           Response.Cache.SetCacheability(HttpCacheability.Private);
           Response.Expires = -1;
           Response.Buffer = true;
 
           Response.AddHeader("Content-Disposition",
                              string.Format("{0};FileName=\"{1}\"",
                                            "attachment",
                                            fileName));
 
           Response.BinaryWrite(result.DocumentBytes);
           Response.End();
       }

For the newest version, this is the reference: http://docs.telerik.com/reporting/programmatic-exporting-report

HTH,
Jimi J


__________________

  Jaime Jegonia
[jts_logo]

Iron Speed MVP Developer
 

". . . and whoever sows generously will also reap generously" 2 Cor 9:6

jimatqsi

Registered:
Posts: 62
Reply with quote  #3 
Thanks, Jimi. I'll have to study this, I don't know anything about Telerik. But it could be something very helpful to work with.

Jim
JimiJ

Avatar / Picture

MVP Developer
Registered:
Posts: 1,954
Reply with quote  #4 
Some learning curve is needed depending on individuals. Nevertheless, surely you will rise confidently above ISD reporting limitations, with greater flexibility.

Jimi J

__________________

  Jaime Jegonia
[jts_logo]

Iron Speed MVP Developer
 

". . . and whoever sows generously will also reap generously" 2 Cor 9:6

pinbot

Avatar / Picture

MVP Consultant
Registered:
Posts: 956
Reply with quote  #5 
Here is an article I wrote about a "better" excel export in Iron  Speed.


It doesn't require Telerik.  Uses free library and you can build only the columns you want.

http://sjc.ironspeed.com/post/a-better-excel-export-6141947#gsc.tab=0



__________________
C. Bryan Patrick II
Iron Speed Designer MVP Consultant
Pseudo Consulting
Previous Topic | Next Topic
Print
Reply

Quick Navigation:

Easily create a Forum Website with Website Toolbox.

Download Iron Speed Designer

Terms of Service Privacy Statement