How can i use ,' ReportObject.AddVariable(string Category,string Name,Object Value)'
hi all,
I want to add my own [VARIABLE] to Fast-Report Designer at Run-Time in [Variables] Section of IDE so
as you know we have a function called [AddVariable] with Following Syntax:
ReportObject.AddVariable(string Category,string Name,Object Value);
i want to declare a string Variable as follow:
ReportObject.AddVariable("My String Variables","LogedInUserName","John Vilson");
so far anything is ok and my Report - Designer displayed successfully BUT when i drag and drop the above variable from IDE to the
Designer and then press the Preveiw Button, Nothing appears !!! BUT if i return NUMERIC value instead of STRING value in above example such as :
ReportObject.AddVariable("My String Variables","GetLogedInUserNAme",12345678);
it appears in preview mode successfully !!! What am i doing wrong?
Thanks in advance.
Kind Regards.
I want to add my own [VARIABLE] to Fast-Report Designer at Run-Time in [Variables] Section of IDE so
as you know we have a function called [AddVariable] with Following Syntax:
ReportObject.AddVariable(string Category,string Name,Object Value);
i want to declare a string Variable as follow:
ReportObject.AddVariable("My String Variables","LogedInUserName","John Vilson");
so far anything is ok and my Report - Designer displayed successfully BUT when i drag and drop the above variable from IDE to the
Designer and then press the Preveiw Button, Nothing appears !!! BUT if i return NUMERIC value instead of STRING value in above example such as :
ReportObject.AddVariable("My String Variables","GetLogedInUserNAme",12345678);
it appears in preview mode successfully !!! What am i doing wrong?
Thanks in advance.
Kind Regards.
Comments
Test with
ReportObject.AddVariable("My String Variables","LogedInUserName","John Vilson"+chr(13));
in vb6 is ok
Bruno
Hi guys,
Anyone know how to do this in C#? Below is what I did:
1) Report.AddVariable("My String Variables","LogedInUserName",12345); <
works
2) Report.AddVariable("My String Variables","LogedInUserName","John"); <
crash
I have tried
3) Report.AddVariable("My String Variables","LogedInUserName","John" + chr(13)); <
doesn't work as well
Is there any ways to solve this in C#? Many thanks.
a categorized variable is treated as an expression for further calculation, so the value passed can be a valid numeric, an expression, to pass a string value you must use extra ' delimiters.
ie. if the value ends up as John it will be treated as an expression and the expression parser will try to calc a value for it, since it dosen't recognize this expression it triggers the ogv event and if no handler is written for the event it will return an error.
if the value in the variable ends up as 'John' , (note the value contains delimiters)it will be treated as a string.
Plase send an email to me! mahbodm@gmail.com
montazeram
fdavood