Free Support Forum - aspose.com

Unable to put Barcode in Report Header

I am trying to put report pagination data into a barcode on the report. Since Paging information is only available in the header, thats where I tried to put the barcode. But now I get a compile error that says:

[rsCRIInPageSection] The custom reportitem ‘BarCode1’ is in the page header or footer. Custom reportitems cannot be used in page headers or footers.

Can anyone tell me if this is a limitation that I can workaround?

@jbriganti,
You may provide more details about the API which you are using and share a runnable sample project with report definition file also for our analysis and testing here.

Header and footer in Reporting services cannot use Custom Report Item. You have to manually draw image with Custom Code.

As Example you can use this article (we need to update it)
https://docs.aspose.com/display/barcodereportingservices/How+to+Display+BarCodes+in+Report+Header

And this topic:

You need to implement custom code with new BarcodeGenerator

Public Function GetBarCodeImage(ByVal codetext As String) As Byte()
Dim objBarcode As New Aspose.BarCode.Generation.BarcodeGenerator(Aspose.BarCode.Generation.EncodeTypes.Code39Standard)
objBarcode.CodeText = codetext
'Generate the barcode image
Dim ms As New System.IO.MemoryStream
objBarcode.Save(ms,Aspose.BarCode.ReportingServices.BarCodeImageFormat.Bmp)
Return ms.GetBuffer()
End Function

And add changes to RSPreviewPolicy.config

<CodeGroup class=“UnionCodeGroup” version=“1” PermissionSetName=“Execution” Name=“Report_Expressions_Default_Permissions” Description="This code group grants default permissions for code in report expressions and Code element. ">

Replace with row

<CodeGroup class=“UnionCodeGroup” version=“1” PermissionSetName=“FullTrust” Name=“Report_Expressions_Default_Permissions” Description="This code group grants default permissions for code in report expressions and Code element. ">