I create a report using FastReport in which there are 2 ReportPage
This report is exported to Excel format and when I open Excel, these 2 sheets are selected at the same time
Below is attached a snippet of code with which I generate a report. The question is, how do i active the one specific sheet?
private static byte[] CreateReport(Stream fastReportTemplateStream, DataSet ds, RepType repType, Dictionary<string, object> parameters = null)
{
FastReport.Utils.Config.WebMode = true;
using (Report report = new Report())
{
report.Load(fastReportTemplateStream);
report.RegisterData(ds);
if (parameters != null)
foreach (var prm in parameters)
report.SetParameterValue(prm.Key, prm.Value);
report.Prepare();
return CreateReport(report, repType);
}
}
public static byte[] CreateReport(Report report, RepType repType)
{
using (MemoryStream mem_str = new MemoryStream())
{
switch (repType)
{
case RepType.XLSX:
report.Export(new FastReport.Export.OoXML.Excel2007Export(), mem_str);
break;
case RepType.PDF:
report.Export(new FastReport.Export.Pdf.PDFExport(), mem_str);
break;
}
return mem_str.ToArray();
}
throw new Exception();
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…