Multipage QR Codes

Stimulsoft Reports.NET discussion
DavideBak
Posts: 13
Joined: Fri Aug 10, 2012 10:45 am

Multipage QR Codes

Post by DavideBak »

Hello,
with Stimulsoft Report .NET there is a way to create a series of QR Codes dynamically based on the amount of data?

I inserted a Barcode and selected QR Codes but if data exceeds the limit of this type of barcode, the designer shows 'Not Valid Data' error.
In this case it's possible to create dynamically other barcodes to avoid this error?

Thanks in advance,
Davide
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Multipage QR Codes

Post by HighAley »

Hello.
DavideBak wrote:with Stimulsoft Report .NET there is a way to create a series of QR Codes dynamically based on the amount of data?

I inserted a Barcode and selected QR Codes but if data exceeds the limit of this type of barcode, the designer shows 'Not Valid Data' error.
In this case it's possible to create dynamically other barcodes to avoid this error?
You could do it in events.
For example, in the BeginRender event of the page. Get there a string that you want to use in the Barcode. If it's too long you could split it to a several parts.
Then you could put the barcode on the DataBend or CrossDataBand.

For more detailed answer we need to see your report and structure of your data.

Thank you.
DavideBak
Posts: 13
Joined: Fri Aug 10, 2012 10:45 am

Re: Multipage QR Codes

Post by DavideBak »

I don't understand how to do it.

I have to create a report with one or more pages that contains one or more qr codes.
Data arrives as a string and i would like report split the string and create dynamically the corresponding qr codes,
but previously i don't the number of barcode to create: they may be 1 or 100.

Can I create a report of this type with Stimulsoft?

Thanks in advance,
Davide
DavideBak
Posts: 13
Joined: Fri Aug 10, 2012 10:45 am

Re: Multipage QR Codes

Post by DavideBak »

The report should look like this image.
Attachments
Report Barcode.jpeg
Report Barcode.jpeg (396.54 KiB) Viewed 3140 times
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Multipage QR Codes

Post by HighAley »

Hello.

It's not clear how do you want do want QR Codes be rendered.
What is your data source look like?
Do you want to get a QR Code for each data row?
How the data string should be splitted?
Maybe the report should be created from one string?

Thank you.
DavideBak
Posts: 13
Joined: Fri Aug 10, 2012 10:45 am

Re: Multipage QR Codes

Post by DavideBak »

Hi Aleksey.

Datasource is not my priority : It can be on .net object or a CSV file.

Preferably the datasource should be a unique string, and then report splits it in N strings.
If it's not possible, datasource can be a list of strings. In this case my problem is create a report
that dinamically create 1, 10, 100 or 1000 barcodes from these list of strings (a QR Code for each data row).

Thank you.
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Multipage QR Codes

Post by HighAley »

Hello.
DavideBak wrote:Datasource is not my priority : It can be on .net object or a CSV file.

Preferably the datasource should be a unique string, and then report splits it in N strings.
If it's not possible, datasource can be a list of strings. In this case my problem is create a report
that dinamically create 1, 10, 100 or 1000 barcodes from these list of strings (a QR Code for each data row).
You could register a set of strings and use it in the report.
Please, look at the attached report template.

Thank you.
Attachments
data.xml
(561 Bytes) Downloaded 261 times
Report.mrt
(4.73 KiB) Downloaded 364 times
DavideBak
Posts: 13
Joined: Fri Aug 10, 2012 10:45 am

Re: Multipage QR Codes

Post by DavideBak »

Great, thank you Aleksey.

Last question :) if my datasource is a .net object, i can pass to qr code an array of bytes?
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Multipage QR Codes

Post by HighAley »

Hello.

You couldn't pass to report the array of bytes.
But you could convert it with next code:

Code: Select all

        public string ByteArrayToString(byte[] buf)
        {
            StringBuilder sb = new StringBuilder();
            for (int index = 0; index < buf.Length; index++)
            {
                sb.Append((char)buf[index]);
            }
            return sb.ToString();
        }
Thank you.
DavideBak
Posts: 13
Joined: Fri Aug 10, 2012 10:45 am

Re: Multipage QR Codes

Post by DavideBak »

Aleksey, Thanks for all the answers!

Davide
Post Reply