David Smith

David Smith

  • NA
  • 2k
  • 0

Microsoft reportviewer control

Apr 29 2010 3:20 AM
I wanted to if anyone know knows how to send multiple reports into one sheet of excel or .xsl

or should i say have 6 different sheets into one .xls file.

right now I have code sending 5 different reports to 5 different .xls,

Each report has its own .xls file. , which is what I don't wont to do.

I want to be able to sent to one .xls sheet or file.

__________________________________________________

at the moment im doing this below in code




Warning[] warnings;
            string[] streamids;
            string mimeType;
            string encoding;
            string extension;
            byte[] bytes;
            FileStream fs;

bytes = RawData1_reportViewer.LocalReport.Render("Excel", null, out mimeType, out encoding, out extension, out streamids, out warnings);

                        fs = new FileStream("C:\\TEMP\\Report_BSA_" + dsCurrentDateValue.ToString("MM_d_yyyy") + ".xls", FileMode.Create);
                        fs.Write(bytes, 0, bytes.Length);
                        fs.Close();

bytes = RawData2_reportViewer.LocalReport.Render("Excel", null, out mimeType, out encoding, out extension, out streamids, out warnings);

                        fs = new FileStream("C:\\TEMP\\Report_BSA_" + dsCurrentDateValue.ToString("MM_d_yyyy") + ".xls", FileMode.Create);
                        fs.Write(bytes, 0, bytes.Length);
                        fs.Close();

bytes = RawData3_reportViewer.LocalReport.Render("Excel", null, out mimeType, out encoding, out extension, out streamids, out warnings);

                        fs = new FileStream("C:\\TEMP\\Report_BSA_" + dsCurrentDateValue.ToString("MM_d_yyyy") + ".xls", FileMode.Create);
                        fs.Write(bytes, 0, bytes.Length);
                        fs.Close();


------------------------------------------------------------------------------------------------
How to send the  3 reports to the same .xls file???????