public static string ExportToPdf(string documentName,int periodId, int pupilId) { ReportProcessor reportProcessor = new ReportProcessor(); Hashtable deviceInfo = new Hashtable(); InstanceReportSource instanceReportSource = new InstanceReportSource (); instanceReportSource.ReportDocument= new ARView2(); instanceReportSource.ReportDocument.DocumentName = documentName; instanceReportSource.Parameters.Add(new Telerik.Reporting.Parameter("PeriodID", periodId)); instanceReportSource.Parameters.Add(new Telerik.Reporting.Parameter("PupilID", pupilId)); RenderingResult result = reportProcessor.RenderReport("PDF", instanceReportSource, deviceInfo); string fileName = result.DocumentName + "." + result.Extension; string filePath = Path.Combine(Path.GetTempPath(), fileName); using (FileStream fs = new FileStream(filePath, FileMode.Create)) { fs.Write(result.DocumentBytes,0,result.DocumentBytes.Length); } return filePath; }if (e.Item.Level == 0) return; string[] parms = e.Item.Value.Split(':'); int periodId = Convert.ToInt32(parms[0]); int pupilId = Convert.ToInt32(parms[1]); var rpt = new ARView2 { DocumentName = string.Format("{0} {1} {2}",cbPermittedPupils.Text.Trim().Replace(",",""), pbARList.SelectedItem.Text.Trim(), ((RadPanelItem)pbARList.SelectedItem.Parent).Text) }; rvAR.ReportSource = new InstanceReportSource { ReportDocument = rpt }; rvAR.ReportSource.Parameters.Add(new Parameter("PeriodID", periodId)); rvAR.ReportSource.Parameters.Add(new Parameter("PupilID", pupilId)); rvAR.RefreshReport();How can I pass the datasource to a subreport from a page?
Ex: "ReportViewer1.Report.SubReport.DataSource = ds"
[]'s
Henrique

.PageNumberText{ white-space:nowrap !important;}if
(i == 0 || i == 2 || i == 4 || i == 6 || i == 8 || i == 10)
{
labelwidthX = 0.1;
labelvalwidthY = 1.4 + 0.4 * (i / 2);
Shape shape = new Shape();
shape.Location =
new Telerik.Reporting.Drawing.PointU(new Telerik.Reporting.Drawing.Unit(0, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(labelvalwidthY + 0.25, Telerik.Reporting.Drawing.UnitType.Inch));
shape.ShapeType =
new Telerik.Reporting.Drawing.Shapes.LineShape(Telerik.Reporting.Drawing.Shapes.LineDirection.EW);
shape.Size =
new Telerik.Reporting.Drawing.SizeU(new Telerik.Reporting.Drawing.Unit(8, Telerik.Reporting.Drawing.UnitType.Inch), new Telerik.Reporting.Drawing.Unit(0.099921144545078278, Telerik.Reporting.Drawing.UnitType.Inch));
shape.Style.BorderStyle.Default = Telerik.Reporting.Drawing.
BorderType.None;
shape.Style.Font.Bold =
true;
this.pageHeader.Items.Add(shape);
}
and we did small code change in export to PDF because of new dlls throwing error. here is the code
void ExportToPDF(ReportBook reportToExport)
{
InstanceReportSource instanceReportSource =
new InstanceReportSource();
instanceReportSource.ReportDocument = reportToExport;
ReportProcessor reportProcessor =
new ReportProcessor();
//RenderingResult result = reportProcessor.RenderReport("PDF", reportToExport, null);
RenderingResult result = reportProcessor.RenderReport("PDF", instanceReportSource, null);
string fileName = result.DocumentName + ".pdf";
Response.Clear();
Response.ContentType = result.MimeType;
Response.Cache.SetCacheability(HttpCacheability.Private);
Response.Expires = -1;
Response.Buffer =
true;
Response.AddHeader(
"Content-Disposition",
string.Format("inline;FileName=\"{1}\"",
"attachment",
fileName));
Response.BinaryWrite(result.DocumentBytes);
Response.End();
}