Appframe Knowledge Base


6 hits
2

Passing Filers to Subreports

'
' This snippet goes into the parent report.
' It copies the parent's filter into the subreport's Tag member
' Tag member will be automatically assigned as FilterString
Private Sub xtraReport1_BeforePrint(ByVal sender As Object, ByVal e As System.Drawing.Printing.PrintEventArgs)
	arpt_ModuleFoo_Subreport.Tag = CType(xtraReport1, Appframe3.Reporting.afReport).Filter
End Sub

reporting win · Perma link post comment Posted by: Kevin Francis Becker (29-apr-2013)

Karl Stroud :
This does not appear to have any affect on filtering of subreports? (20-jun-2016)
Kevin Francis Becker :
Sorry this doesn't seem to do anything--I presume it did at one time. (24-jun-2016)
1

Export report to PDF and save to filestore

Dim vReport As New AppFrame3.Reporting.afReport(vReportID, vFilter)
vReport.LoadLayoutAndData()

Dim vMemoryStream As System.IO.MemoryStream = New System.IO.MemoryStream()
vReport.ExportToPdf(vMemoryStream)

vMemoryStream.Seek(0, System.IO.SeekOrigin.Begin)
Dim vFileStoreLayer As New AppFrame3.Common.Data.afFileStoreLayer
vFileStoreLayer.InsertFile(vMemoryStream, vFileName, vViewName, vPrimKey)

vMemoryStream.Close()

reporting win · Perma link post comment Posted by: Peter Øren (13-jan-2012)

Kevin Francis Becker :
I needed to prepare a new row in the filestore table as per Trong's post https://www.pims.no/teamdoc?8088/151517/post-811237 (17-okt-2017)
Kevin Francis Becker :
Dim vTable As DataTable = CType(pFilestoreTableView.DataSource, DataTable) Dim vNewRow As DataRow = vTable.NewRow() vTable.Rows.Add(vNewRow) Dim vPrimKey = vNewRow("PrimKey").ToString() Dim vViewName = pFilestoreTableView.DataSource.ToString() (17-okt-2017)
0

How to change the Globalization of a field in a report by script

Private Sub label3_BeforePrint(ByVal sender As Object, ByVal e As System.Drawing.Printing.PrintEventArgs)
      Dim culture as System.Globalization.CultureInfo = new System.Globalization.CultureInfo("en-GB")
      sender.Text = String.Format(culture, "{0:dd MMM yyyy }", GetCurrentColumnValue("CutOff"))
End Sub

reporting win · Perma link post comment Posted by: Peter Øren (08-jun-2015)

0

How to use report parameters through code

' Step 1:
' -------
' Create report parameters in the designer with default values*. Make sure that the
' "Show in the parameters panel" box is unchecked.
'
' * see: http://documentation.devexpress.com/#XtraReports/CustomDocument9998/Creating
'
' Step 2:
' -------
' Create the applicable *ReportArgs object in your form, pass parameters through the
' AddParameter method:

Dim vArgs As New OpenReportArgs("arpt_Demo_MyReportWithParameters")
vArgs.AddParameter("Foo",           ' Name
                   GetType(String), ' Type
                   "Bar") '         ' Value

CR3.OpenReport(vArgs)

' Step 3:
' -------
' To consume the parameters in your report, use the Parameters property. Example:

Private Sub XtraReport_BeforePrint(
	ByVal sender As Object,
	ByVal e As System.Drawing.Printing.PrintEventArgs)

	Dim vFoo = Parameters("Foo")

	cFooLabel.Text = Parameters("Foo").Value

End Sub

reporting win · Perma link post comment Posted by: Jarl Erik Schmidt (12-feb-2013)

0

How to hide bands with only one record

	Try
	
		Dim vReport As DevExpress.XtraReports.UI.XtraReport = sender.Report
	
		Dim vPrevValue As String = vReport.GetPreviousColumnValue("GroupField")
		Dim vCurrValue As String = vReport.GetCurrentColumnValue("GroupField")
		Dim vNextValue As String = vReport.GetNextColumnValue("GroupField")

		If vCurrValue <> vNextValue AndAlso vCurrValue <> vPrevValue Then
			e.Cancel = True
		End If

	Catch ex As Exception

	End Try

reporting win · Perma link post comment Posted by: Håvard Ravatn (19-jun-2012)

0

Concatenating reports

Try
	Dim vCollection As Appframe3.Reporting.afReport
    Dim vDataTable As DataTable = afAccessLayer.GetData(vRecordSource)

    For Each vRow As DataRow In vDataTable.Rows
        Dim vReport As New Appframe3.Reporting.afReport("arpt_CRM_Test", "TestId = " + vRow("TestId").ToString())
        vReport.LoadLayoutAndData()
        vReport.CreateDocument()

        If vCollection Is Nothing Then
            vCollection = vReport
        Else
            vCollection.Pages.AddRange(vReport.Pages)
        End If
    Next

    Dim vMemoryStream As System.IO.MemoryStream = New System.IO.MemoryStream()
    vCollection.ExportToPdf(vMemoryStream)
    vMemoryStream.Seek(0, System.IO.SeekOrigin.Begin)
    Dim vFileStoreLayer As New Appframe3.Common.Data.afFileStoreLayer
    vFileStoreLayer.InsertFile(vMemoryStream, "test.pdf", "atbv_CRM_Tests", pPrimKey)
    Me.atbv_CRM_ProduksjonerFiles.RefreshDataSource()
Catch ex As Exception
    Throw
End Try

reporting win · Perma link post comment Posted by: Peter Øren (08-mai-2012)