Parsing a Database field for special value

Stimulsoft Reports.NET discussion
Stephan1
Posts: 122
Joined: Fri Aug 31, 2007 7:22 am
Location: Germany

Parsing a Database field for special value

Post by Stephan1 »

Hi,


is it possible to parse a string of a Databasefield for a special value like "[PB]" which causes to genereate a page break ?.

And then printing on next page till the next "[PB]" occurs.

We need that for a customer who has large desciption for Producs and want to be able to put a special Char or Word in that Text
so that when printing a page break occurs. This can be more than once.

Like this:

Page 1

blabla bla bla bla bla bla bla
blabla bla bla bla bla bla bla
blabla bla bla bla bla bla bla
[PB]

Page 2
blabla bla bla bla bla bla bla
[PB]

Page 3
blabla bla bla bla bla bla bla
..
...

The above Text "bla bla" etc. comes from a Databasefield like. Products.Description

Some kind of parsing the text while rendering is needed i guess.

Thx for your help

Stephan


Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

Parsing a Database field for special value

Post by Edward »

Hi Stephan,

No problem, it is possible to parse.

Please create the function which can show only the part of the text between two adjacent [PB] symbols and the function for calculation of the necessary page breaks.

Then set CountData of the DataBand according to the number of pagebreaks. NewPageAfter property must be in true, CanBreak and CanGrow also must be in true for both DataBand and StiText.

This can be a Detail databand, so you can set CountData in the BeforePrint event of the Master databand too.

Thank you.
Stephan1
Posts: 122
Joined: Fri Aug 31, 2007 7:22 am
Location: Germany

Parsing a Database field for special value

Post by Stephan1 »

Edward wrote:Hi Stephan,

No problem, it is possible to parse.

Please create the function which can show only the part of the text between two adjacent [PB] symbols and the function for calculation of the necessary page breaks.

Then set CountData of the DataBand according to the number of pagebreaks. NewPageAfter property must be in true, CanBreak and CanGrow also must be in true for both DataBand and StiText.

This can be a Detail databand, so you can set CountData in the BeforePrint event of the Master databand too.

Thank you.
Thx Edward for your help,

can you provide for this a samplereport with a filled Databasefield ?.

so i can migrate that to our needs ?.

Thx a lot

Stephan
Jan
Posts: 1265
Joined: Thu Feb 19, 2009 8:19 am

Parsing a Database field for special value

Post by Jan »

Hello,

Please check Report Code, BeginRenderEvent of report and report variables.

Thank you.
Attachments
189.SampleReport.mrt
(15.49 KiB) Downloaded 254 times
Stephan1
Posts: 122
Joined: Fri Aug 31, 2007 7:22 am
Location: Germany

Parsing a Database field for special value

Post by Stephan1 »

Jan wrote:Hello,

Please check Report Code, BeginRenderEvent of report and report variables.

Thank you.
Thx for the report Jan,

but i can't get it work for our reports. We have a Databand with Childbands. And we need the Split in the ChildDataBand which has no Countdata.

Is it possible to send you the existing report and you can have a look if it's possible to use the technique you described ?.

Also i saw there is a rtf Component in the Toolbar of the reportdesigner.

Does this rtf-Component support the Pagebreak tag ? So we can use a rtf textfield ? or does this rtf-component only support. Font, Forecolor, Backcolor, italic, bold ?.

Thx again for you help so far

Stephan
Jan
Posts: 1265
Joined: Thu Feb 19, 2009 8:19 am

Parsing a Database field for special value

Post by Jan »

Hello Stephan,
but i can't get it work for our reports. We have a Databand with Childbands. And we need the Split in the ChildDataBand which has no Countdata.

Is it possible to send you the existing report and you can have a look if it's possible to use the technique you described ?.
Please send your report to support@stimulsoft.com. Add url to this topic in your EMail.
Also i saw there is a rtf Component in the Toolbar of the reportdesigner.

Does this rtf-Component support the Pagebreak tag ? So we can use a rtf textfield ? or does this rtf-component only support. Font, Forecolor, Backcolor, italic, bold ?.
Rtf component support standard Rich Text. Also it support CanBreak property.

Thank you.
Stephan1
Posts: 122
Joined: Fri Aug 31, 2007 7:22 am
Location: Germany

Parsing a Database field for special value

Post by Stephan1 »

Jan wrote:Hello Stephan,
but i can't get it work for our reports. We have a Databand with Childbands. And we need the Split in the ChildDataBand which has no Countdata.

Is it possible to send you the existing report and you can have a look if it's possible to use the technique you described ?.
Please send your report to support@stimulsoft.com. Add url to this topic in your EMail.
Also i saw there is a rtf Component in the Toolbar of the reportdesigner.

Does this rtf-Component support the Pagebreak tag ? So we can use a rtf textfield ? or does this rtf-component only support. Font, Forecolor, Backcolor, italic, bold ?.
Rtf component support standard Rich Text. Also it support CanBreak property.

Thank you.
Ok i will send you the report,

what format you need ? .mrt ? mdc ? or mrz ?

Also i tried using rtf component and setting a /page this doesn't work.

thx

Stephan
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

Parsing a Database field for special value

Post by Edward »

Hi

Please check the e-mail, as we have sent the answer to you.

Thank you.
Stephan1
Posts: 122
Joined: Fri Aug 31, 2007 7:22 am
Location: Germany

Parsing a Database field for special value

Post by Stephan1 »

Edward wrote:Hi

Please check the e-mail, as we have sent the answer to you.

Thank you.
Hi Edward,

thx for your reply.

But this doesn't fix our problem. Please see e-mail i sent you.

Thx

Stephan
Stephan1
Posts: 122
Joined: Fri Aug 31, 2007 7:22 am
Location: Germany

Parsing a Database field for special value

Post by Stephan1 »

Hi Edward,

thx for your reply.

Please Check mail i sent to the Ticket System.

I can't figure it out to work with our reports. Please take a look at the sample report i provided.

Thx

Stephan
Post Reply