or
Public Sub New()
InitializeComponent()
'Me.ReportParameters("campdateid").Value = 7 'default here
Me._campdateid = Me.ReportParameters("campdateid").Value
'Me.TextBox1.Value = Me.ReportParameters("campdateid").Value.ToString
Me.cdbll.connectionString = bo.Constants.ConnectionString
Me.rbll.connectionString = bo.Constants.ConnectionString
End Sub
Private _campdateid As Integer = 0
Private _contactlist As System.Data.DataTable = Nothing
Private cdbll As New dal.CampDate()
Private rbll As New dal.Registration
Private _registrations As DataTable = Nothing
'Private Sub SubReport1_NeedDataSource(ByVal sender As Object, ByVal e As System.EventArgs) Handles SubReport1.NeedDataSource
' Dim subReportItem As Telerik.Reporting.Processing.SubReport = TryCast(sender, Telerik.Reporting.Processing.SubReport)
' subReportItem.InnerReport.DataSource = Me._contactlist
'End Sub
Private Sub CampRegistration_NeedDataSource(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.NeedDataSource
' Exit Sub
'---initial title of report
Dim cd As acmilan.bo.CampDate = cdbll.getCamp(Me._campdateid)
If cd IsNot Nothing Then
Me.TextBox1.Value = cd.name & " @ " & cd.city & ", " & cd.state
Me.TextBox3.Value = cd.start.ToLongDateString & " to " & cd.end.ToLongDateString
End If
Try
'---get registrations for campdate
Me._registrations = Me.rbll.getAllForCampDate(Me._campdateid)
TryCast(sender, Telerik.Reporting.Processing.Report).DataSource = Me._registrations
Catch ex As Exception
'Me.TextBox1.Value = ex.StackTrace & ex.Message
End Try
End Sub
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
Dim repReport As New thunder.apps.acmilan.reports.CampRegistration
Dim cdbll As New bll.CampDate(thunder.framework.dal.sql.DataAccess.rMethod.ObjectList)
Dim id As Integer = Convert.ToInt32(Request.QueryString("campdateid"))
Dim cd As bo.CampDate = cdbll.getCampdate(id)
If cd IsNot Nothing Then
Me.HyperLink1.NavigateUrl = "campprofile.aspx?campid=" & cd.campid.ToString
repReport.DocumentName = cd.name & "Camp_Registration_Report_" & id.ToString
repReport.ReportParameters("campdateid").Value = id
Me.ReportViewer1.Resources.ProcessingReportMessage = "Generating Camp Registration ID" & repReport.ReportParameters("campdateid").Value.ToString
Me.ReportViewer1.Report = repReport
Me.ReportViewer1.DataBind()
Me.ReportViewer1.RefreshReport()
Else
End If
End If
End Sub
protected void Page_Load(object sender, EventArgs e) { Hashtable deviceInfo = new Hashtable(); deviceInfo["JavaScript"] = "this.print({bUI: false, bSilent: true, bShrinkToFit: true});"; ReportProcessor reportProcessor = new ReportProcessor(); RenderingResult result = reportProcessor.RenderReport("PDF", new BarcodesReport(), deviceInfo); string fileName = result.DocumentName + ".pdf"; Response.Clear(); Response.ContentType = result.MimeType; Response.Cache.SetCacheability(HttpCacheability.Private); Response.Expires = -1; Response.Buffer = true; Response.BinaryWrite(result.DocumentBytes); Response.End(); }<div style="float:left;width:850px;"> <div style="height:792px;"> <telerik:ReportViewer ID="ReportViewer1" runat="server" style="border:1px solid #ccc;" width="99%" height="792px" ReportBookID="ReportBookControl1" Skin="Office2007"> <resources reportparameterspreviewbuttontext="View Report" /> </telerik:ReportViewer> </div></div>