public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() { yreport1 rpt = new yreport1(); rpt.Site = this.Site; return(rpt); }
public void HideAllLine() { yreport1 y = new yreport1(); var f = y.Section3.ReportObjects; foreach (var ob in f) { if (ob is BoxObject) { if ((ob as BoxObject).Kind == CrystalDecisions.Shared.ReportObjectKind.BoxObject) { var c = (BoxObject)y.ReportDefinition.ReportObjects[(ob as BoxObject).Name]; c.LineStyle = CrystalDecisions.Shared.LineStyle.NoLine; //(ob as BoxObject).LineColor = Color.Transparent; (ob as BoxObject).LineStyle = CrystalDecisions.Shared.LineStyle.NoLine; } } else if (ob is LineObject) { if ((ob as LineObject).Kind == CrystalDecisions.Shared.ReportObjectKind.LineObject) { var c = (LineObject)y.ReportDefinition.ReportObjects[(ob as LineObject).Name]; c.LineStyle = CrystalDecisions.Shared.LineStyle.NoLine; // (ob as LineObject).LineColor = Color.Transparent; (ob as LineObject).LineStyle = CrystalDecisions.Shared.LineStyle.NoLine; } } } y.Refresh(); }
public void Load_Report() { Custom = dtreport.Rows[0]["LongName"].ToString(); yreport1 yreport = new yreport1(); yreport.PrintOptions.ApplyPageMargins(new PageMargins(0, 0, 0, 0)); dtreport.Rows[0]["LongName"] = dtreport.Rows[0]["LongName"] + dtreport.Rows[0]["AliasKBN"].ToString(); dtreport.AcceptChanges(); yreport.SetDataSource(dtreport); GetSource gs = GetPrintData(dtreport); //yreport.SetParameterValue("pa_1", gs.pa_1); //yreport.SetParameterValue("pa_2", gs.pa_2); //yreport.SetParameterValue("pa_3", gs.pa_3); //yreport.SetParameterValue("pa_4", gs.pa_4); //yreport.SetParameterValue("pa_5", gs.pa_5); //yreport.SetParameterValue("pa_6", gs.pa_6); //yreport.SetParameterValue("pan_1", gs.pan_1); //yreport.SetParameterValue("pan_2", gs.pan_2); //yreport.SetParameterValue("pan_3", gs.pan_3); //yreport.SetParameterValue("pan_4", gs.pan_4); //yreport.SetParameterValue("pan_5", gs.pan_5); //yreport.SetParameterValue("pan_6", gs.pan_6); //yreport.SetParameterValue("pan_7", gs.pan_7); //yreport.SetParameterValue("sg_1", gs.sg_1); //yreport.SetParameterValue("sg_2", gs.sg_2); //yreport.SetParameterValue("sg_3", gs.sg_3); //yreport.SetParameterValue("sg_4", gs.sg_4); //yreport.SetParameterValue("sg_5", gs.sg_5); //yreport.SetParameterValue("sg_6", gs.sg_6); //yreport.SetParameterValue("sg_7", gs.sg_7); //yreport.SetParameterValue("Custom", Custom); crystalReportViewer1.ReportSource = null; // crystalReportViewer1.RefreshReport(); crystalReportViewer1.ReportSource = yreport; // crystalReportViewer1.RefreshReport(); }