Пример #1
0
        public static void Export(Microsoft.Reporting.WinForms.LocalReport report, bool print = true)
        {
            string deviceInfo =
                @"<DeviceInfo>
                <OutputFormat>EMF</OutputFormat>
                <PageWidth>8.26in</PageWidth>
                <PageHeight>11.69in</PageHeight>
                <MarginTop>0.4in</MarginTop>
                <MarginLeft>0.2in</MarginLeft>
                <MarginRight>0.2in</MarginRight>
                <MarginBottom>0.2in</MarginBottom>
            </DeviceInfo>";

            Warning[] warnings;
            m_streams = new List <Stream>();
            report.Render("Image", deviceInfo, CreateStream,
                          out warnings);
            foreach (Stream stream in m_streams)
            {
                stream.Position = 0;
            }

            if (print)
            {
                Print();
            }
        }
Пример #2
0
        public EMFStreamPrintDocument(Microsoft.Reporting.WinForms.LocalReport localReport, string ReportName)
            : base()
        {
            this.m_ReportName = ReportName;
            string strMessage = string.Empty;

            if (this.ReadSetting(out strMessage) == null)
            {
                this.m_ErrorMessage = strMessage;
            }
            if (this.m_ErrorMessage == string.Empty)
            {
                this.m_LocalReport = localReport;
            }
        }
Пример #3
0
        private void RenderAllLocalReportPages(Microsoft.Reporting.WinForms.LocalReport localReport)
        {
            try
            {
                string deviceInfo = CreateEMFDeviceInfo();

                Warning[] warnings;

                localReport.Render("IMAGE", deviceInfo, LocalReportCreateStreamCallback, out warnings);
            }
            catch (Exception e)
            {
                MessageBox.Show("error :: " + e);
            }
        }
Пример #4
0
        public EMFStreamPrintDocument(Microsoft.Reporting.WinForms.LocalReport localReport, PrintSetting printSetting)
            : base()
        {
            this.printSetting  = printSetting;
            this.m_LocalReport = localReport;

            setPrinterSettings(this.PrinterSettings, this.printSetting);
            string retMessage = invalidatePrintSetting(this.printSetting);

            if (retMessage != string.Empty)
            {
                throw new Exception(retMessage);
            }

            setPageSettings(this.PrinterSettings.DefaultPageSettings, this.printSetting);
            setPageSettings(this.DefaultPageSettings, this.printSetting);
        }
Пример #5
0
 private void rptViewer_Drillthrough(object sender, Microsoft.Reporting.WinForms.DrillthroughEventArgs e)
 {
     if (this.m_DrillDataSet == null)
     {
         System.Windows.Forms.MessageBox.Show("Report Viewr: \r\n    The dataset name for the report does not exist or is empty!");
         return;
     }
     else
     {
         if (this.m_DrillDataSourceName == string.Empty)
         {
             System.Windows.Forms.MessageBox.Show("Report Viewr: \r\n    The datasource is of the wrong type!");
             return;
         }
         else
         {
             Microsoft.Reporting.WinForms.LocalReport report = e.Report as Microsoft.Reporting.WinForms.LocalReport;
             report.DataSources.Add(new Microsoft.Reporting.WinForms.ReportDataSource(this.m_DrillDataSourceName, this.GetTableCollection(this.m_DrillDataSet)[0]));
         }
     }
 }
Пример #6
0
        public override byte[] export(string fileType)
        {
            var rpt = new Microsoft.Reporting.WinForms.LocalReport();

            //rpt.ReportPath = "Rpt01.rdlc";
            rpt.EnableExternalImages = true;


            for (int i = 0; i < this.ds.Tables.Count; i++)
            {
                var o = new Microsoft.Reporting.WinForms.ReportDataSource(this.ds.Tables[i].TableName, this.ds.Tables[i]);
                rpt.DataSources.Add(o);
            }

            //string sReportName = Request.QueryString["ReportName"];
            System.IO.MemoryStream ms = new System.IO.MemoryStream(this.output);
            rpt.LoadReportDefinition(ms);


            Byte[] results = rpt.Render(fileType);

            return(results);
        }
Пример #7
0
 public AutoPrintCls(Microsoft.Reporting.WinForms.LocalReport localReport)
     : this((Report)localReport)
 {
     RenderAllLocalReportPages(localReport);
 }
Пример #8
0
 protected override void RenderLocalReport(LocalReport report)
 {
     m_mainStreamBytes = report.InternalRender(base.Format, base.AllowInternalRenderers, base.DeviceInfo, base.PageCountMode, out m_mainStreamMimeType, out string _, out m_mainStreamFileNameExt, out string[] _, out m_warnings);
 }
Пример #9
0
 public ReportInfo(LocalReport localReport, ServerReport serverReport)
 {
     m_localReport  = localReport;
     m_serverReport = serverReport;
 }