I am working in the designer and need to know if there is a way to do a checkbox. I am making a dynamic pdf and with the underlying data I need to display a checkbox as checked or not. is there a way to do that. Also can you concantinate fields in a recordbox such as FirstName & "" & Lastname.
checkboxes
Re: checkboxes
Support · Aug 15, 2008Hello,
For a checkbox you can add a small Rectangle and then add a Label over top of it using the ZapfDingbats font (numbers '3' and '4' are checks).
Just add the following lines of and it will create a checkbox with a check mark:
objPage.Elements.Add( new Rectangle( 100, 120, 10, 10, Color.Black ) );
objPage.Elements.Add( new Label( "3", 102, 115, 10, 10, Font.ZapfDingbats, 14 ) );
You cannot concatinate field within the RecordBox report element but you can using the RecordArea report element.
Thanks,
ceTe Software Support Team
Re: checkboxes
Forum member · Aug 15, 2008where and how in the record area do you do that, for instance in the dataset that I'm using to fill in the designer pdf I have a Fist Name field and a Last Name field. How to I make the record area show them together. Also is there any documentation that shows examples of how to do inline code to fill items in the designer.
Re: checkboxes
Forum member · Aug 15, 2008Ok figured out the basic name concantination. Now can you do if statements somehow. For example in the database the data is a value of Y. when I display it for a checkbox I want to change it to an X. is there a way to do an if statement in a record box or record area to do that. for example iif(value = y,x,"")
Re: checkboxes
Support · Aug 15, 2008Hello,
You can use the IIF function within designer without any problem. Following is the syntax to use it:
IIF( GTE( 2, 0 ), FirstName, LastName ): Returns one of two values depending on the value of 'a'.
You can also refer to the list of othe functions that are supported by the ReportWriter product in the Help Documentation installed with the download. Following is the navigation path: DynamiPDF ReportWriter for .NET --> Programming with ReportWriter for .NET --> Expressions --> Functions
Thanks,
ceTe Software Support Team
Re: checkboxes
Forum member · Aug 15, 2008I'v tried these two thing and apperently I have the wrong syntacs for the IIF.
For Record Area in the text Field I put
#IIF( FDPIRFg = "Y", "X", "Y" )#
Exception Details: ceTe.DynamicPDF.ReportWriter.DplxParseException: Invalid IIF function detected.
for Record box in the field property I put #IIF( FDPIRFg = "Y", "X", "Y" )# and got System.IndexOutOfRangeException:
when I take out the #'s I get ceTe.DynamicPDF.ReportWriter.DplxParseException: Invalid IIF function detected.
In my Data the FDPIRFg has an "N"
Re: checkboxes
Forum member · Aug 15, 2008I've tried several of the functions in the examples and I get invalid function on all of them
Re: checkboxes
Support · Aug 15, 2008Hello,
You will need to use the EQ method instead of the equal (=) sign directly:
#IIF( EQ(FDPIRFg,"Y"), "X", "Y" )#
Thanks,
ceTe Software Support Team
Re: checkboxes
Forum member · Aug 15, 2008I still get Invalid IIF function detected.
I put it into the text field of a record area in the designer.
Re: checkboxes
Support · Aug 15, 2008Hello,
It looks like there is a bug with the IIF function. If there is a space after the first comma it is throwing an exception. Try removing the spaces and will should work:
#IIF(EQ(FDPIRFg,"Y"),"X","Y")#
We've forwarded this to the development team for resolution. We'll let you know when a new build it available containing the fix.
Thanks,
ceTe Software Support Team
Re: checkboxes
Forum member · Aug 15, 2008with what you sent I get an error of, Input string was not in a correct format.
just to be sure I'm putting it in the correct place I have put
#IIF(EQ(FDPIRFg,"Y" ),"X","Y")# into the text of a record area
Re: checkboxes
Support · Aug 18, 2008Hello,
The reason you get the error is because the "EQ" function only accepts integer values. To compare strings use the "StrComp( a, b") function and that will solve your problem.
We also have a new build available that will allow using space after the first comma. If you are interested in getting the new DLL files, please send an email to our [^a|mailto:support@cete.com|Support Team^] and they will send you the latest DLL files.
Thanks,
ceTe Software Support Team
Re: checkboxes
Forum member · Aug 20, 2008Thank you I finally got it to work using
IIF(strcomp(HispanicFg,"Y"),"X","") although I found that the fist value is the false value and the second value it the true value.