Ejemplo n.º 1
0
        protected void SalesOrderDetail_Click(object sender, EventArgs e)
        {
            Rdl.Engine.Report rpt = new Rdl.Engine.Report();
            rpt.Load(new FileStream(@"C:\Documents and Settings\MEmerson.VITALBASICS\My Documents\Visual Studio Projects\rdlTest\SampleReports\Sales Order Detail.rdl", FileMode.Open, FileAccess.Read, FileShare.Read),
                     @"C:\Documents and Settings\MEmerson.VITALBASICS\My Documents\Visual Studio Projects\rdlTest\SampleReports");

            ReportParameters.SetReport(rpt);
        }
Ejemplo n.º 2
0
        private void btnEmployeeSalesSummary_Click(object sender, EventArgs e)
        {
            Rdl.Engine.Report rpt = new Rdl.Engine.Report();
            rpt.Load(new FileStream(@"C:\Documents and Settings\MEmerson.VITALBASICS\My Documents\Visual Studio Projects\rdlTest\SampleReports\Employee Sales Summary.rdl", FileMode.Open, FileAccess.Read, FileShare.Read),
                     @"C:\Documents and Settings\MEmerson.VITALBASICS\My Documents\Visual Studio Projects\rdlTest\SampleReports");

            parametersEntry1.Show();
            parametersEntry1.SetReport(rpt);
        }
Ejemplo n.º 3
0
        private void btnProductCatalog_Click(object sender, EventArgs e)
        {
            Rdl.Engine.Report rpt = new Rdl.Engine.Report();
            rpt.Load(new FileStream(@"C:\Documents and Settings\MEmerson.VITALBASICS\My Documents\Visual Studio Projects\rdlTest\SampleReports\Product Catalog.rdl", FileMode.Open, FileAccess.Read, FileShare.Read),
                     @"C:\Documents and Settings\MEmerson.VITALBASICS\My Documents\Visual Studio Projects\rdlTest\SampleReports");

            rpt.Run();

            reportViewer1.SetReport(rpt);
        }
Ejemplo n.º 4
0
        protected void TerritorySalesDrilldown_Click(object sender, EventArgs e)
        {
            Rdl.Engine.Report rpt = new Rdl.Engine.Report();
            rpt.Load(new FileStream(@"C:\Documents and Settings\MEmerson.VITALBASICS\My Documents\Visual Studio Projects\rdlTest\SampleReports\Territory Sales Drilldown.rdl", FileMode.Open, FileAccess.Read, FileShare.Read),
                     @"C:\Documents and Settings\MEmerson.VITALBASICS\My Documents\Visual Studio Projects\rdlTest\SampleReports");

            rpt.Run();
            ReportParameters.SetReport(null);
            ReportViewer.SetReport(rpt);
        }
Ejemplo n.º 5
0
        private void buttonCompanySales_Click(object sender, EventArgs e)
        {
            parametersEntry1.Hide();
            Rdl.Engine.Report rpt = new Rdl.Engine.Report();
            rpt.Load(new FileStream(@"C:\Documents and Settings\MEmerson.VITALBASICS\My Documents\Visual Studio Projects\rdlTest\SampleReports\Company Sales.rdl", FileMode.Open, FileAccess.Read, FileShare.Read),
                     @"C:\Documents and Settings\MEmerson.VITALBASICS\My Documents\Visual Studio Projects\rdlTest\SampleReports");

            rpt.Run();

            reportViewer1.SetReport(rpt);
        }
Ejemplo n.º 6
0
        private void btnSalesOrderDetail_Click(object sender, EventArgs e)
        {
            Rdl.Engine.Report rpt = new Rdl.Engine.Report();
            rpt.Load(new FileStream(@"C:\Documents and Settings\MEmerson.VITALBASICS\My Documents\Visual Studio Projects\rdlTest\SampleReports\Sales Order Detail.rdl", FileMode.Open, FileAccess.Read, FileShare.Read),
                     @"C:\Documents and Settings\MEmerson.VITALBASICS\My Documents\Visual Studio Projects\rdlTest\SampleReports");

            RdlViewer.ParametersDialog dlg = new RdlViewer.ParametersDialog(rpt);
            dlg.Title = "Sales Order Detail Parameters";
            if (dlg.ShowDialog() == DialogResult.OK)
            {
                rpt.Run();

                reportViewer1.SetReport(rpt);
            }
        }
Ejemplo n.º 7
0
        void btnAction_Click(object sender, EventArgs e)
        {
            if (FindControl("tbAction") != null)
            {
                // Get the ID of the element which triggered the action
                string actionID = ((HiddenField)FindControl("tbAction")).Value;
                // Prevent recursion
                if (actionID != string.Empty)
                {
                    // Find the named text action element.
                    Rdl.Render.ActionElement ae = (Rdl.Render.ActionElement)_htmlReport.SourceReport.BodyContainer.FindNamedElement(actionID);

                    if (ae != null)
                    {
                        // If the action is a drill-through, then load the new report,
                        // set the parameters and open the report.
                        if (ae.DrillThroughReportName != null)
                        {
                            string reportName = ae.DrillThroughReportName;

                            Rdl.Engine.Report rpt;

                            System.Runtime.Remoting.ObjectHandle oh = null;
                            try
                            {
                                oh = Activator.CreateInstance(reportName, "Rdl.Runtime." + reportName.Replace(' ', '_'));
                            }
                            catch  { }
                            if (oh != null)
                            {
                                rpt = ((Rdl.Runtime.RuntimeBase)oh.Unwrap()).Report;
                            }
                            else
                            {
                                if (!reportName.Contains("\\"))
                                {
                                    reportName = _htmlReport.SourceReport.Report.ReportPath + reportName;
                                }
                                if (!reportName.Contains(".rdl"))
                                {
                                    if (File.Exists(reportName + ".rdl"))
                                    {
                                        reportName += ".rdl";
                                    }
                                    else if (File.Exists(reportName + ".rdlc"))
                                    {
                                        reportName += ".rdlc";
                                    }
                                }
                                if (!File.Exists(reportName))
                                {
                                    throw new Exception("Unable to locate sub report " + reportName);
                                }

                                rpt = new Rdl.Engine.Report();
                                FileStream fs = new FileStream(reportName,
                                                               FileMode.Open, FileAccess.Read, FileShare.Read);
                                rpt.Load(fs,
                                         _htmlReport.SourceReport.Report.ReportPath);
                                fs.Close();
                                fs.Dispose();
                            }

                            foreach (Rdl.Render.ActionElement.ActionParameter parm in ae.DrillThroughParameterList)
                            {
                                rpt.ReportParameters[parm.Name].Value  = parm.Value;
                                rpt.ReportParameters[parm.Name].Hidden = true;
                            }
                            Rdl.Render.GenericRender render = rpt.Run();

                            _reportSessionID = "RenderedReport_" + (reportIndex++).ToString();
                            ((HiddenField)FindControl("tbReportID")).Value = _reportSessionID;

                            SetReport(render);
                            return;
                        }
                    }
                }
            }
        }