Reading Crystal parameters
I am writting a Crystal application, where users could run adhoc reports and schedule them. My AdHoc options works fine, but I am having some issues with the Scheduling portion. In my project, to read the parameters, I am using CrystalReportsPartsViewer control. Once I load the report to my session object and apply all the logon information, I issue the following command to display the parameters.
crptPartsViewer.ReportSource = Session("myReport")
Once the user enters the parameters and click on OK button, I read the parameters in the event PreRender of the CrystalReportsPartsViewer control and save them in the database for the schedular to read and process.
following is a portion of the parameter reading code:
Dim myParameterFields As New ParameterFields
myParameterFields = rptPartsViewer.ParameterFieldInfo
Dim MyparamField As New ParameterField
Dim i As Integer = 0
Dim strParamName As String = ""
Dim strParameterType As String
Dim strValues As String = ""
For i = 0 To myParameterFields.Count - 1
strParamName = myParameterFields.Item(i).Name
MyparamField.CurrentValues = myParameterFields.Item(i).CurrentValues
strParameterType = myParameterFields.Item(i).ParameterValueType
Dim myParameterdiscrVal As New ParameterDiscreteValue
Dim myParameterRangeVal As New ParameterRangeValue
Dim bIsRangeValue As Boolean = False
Dim j As Integer = 0
For j = 0 To MyparamField.CurrentValues.Count - 1
If MyparamField.CurrentValues.Item(j).IsRange = True Then
bIsRangeValue = True
myParameterRangeVal = MyparamField.CurrentValues.Item(j)
strValues = strValues & myParameterRangeVal.StartValue & "@^" & myParameterRangeVal.EndValue
Else
myParameterdiscrVal = MyparamField.CurrentValues.Item(j)
strValues = strValues & "@^" & myParameterdiscrVal.Value
End If
Next
My issue is, this works on and off. It works 9/10 times and stops working for a little while and starts working again. I thought of using CrystalReportsViewer control, but when the user clicks ok, reportsviewer starts processing the report. So i am using the partsviewer.
I am not sure whether this is the way to do it (read parameters without processing the report), but this is the only way that I could come up with. Could any one let me know whether there a better way for reading the parameters, once they are entered? Or am I doing it correct?
Any help is greatly appreciated.
Can you clarify which version of crystal reports you are using. I know in XIr2 and earlier, it took 2 postbacks before these values were accessible. Its not something that is intended to be read though. To be able to guarantee the value, you would need to create your own prompts.
Similar Messages
-
How to read Crystal Report file Design version programmatically
Hi,
I am working on a project where I need the read Crystal file header and extract information that which designer was used to create the (Crystal) report. This will help me do some specific task if the version of the crystal used is very old (say older than 7.0), relatively new (say between 7.0 and 11.0) and the latest (11.0 or later).
I have downloaded the SDK and all the dlls, but I just couldn't find any API or function using which I can get this info.
Could you please let me know if there is any way to read this information programmatically from a crystal file?
(I know this info can be seen in Crystal designer, but I need to do it at runtime).
Thanks.
Edited by: addi2011 on Mar 14, 2011 2:02 PMUnfortunately, not enough info...
if you are using CR for Eclipse, please post your query here:
SAP Crystal Reports, version for Eclipse
Before you do, I'd highly recommend having a quick peek at this:
What do I need to do to get the fastest issue resolution?
If you are using BI, post your query here:
Java SDK Application Development
- Ludek
Senior Support Engineer AGS Product Support, Global Support Center Canada
Follow us on Twitter -
How to read URL Parameters in ABAP WebDynpro ?
Hi,
How and where (which class, method) in ABAP WebDynpro we can read URL Parameters ? I found answers for WebDynpro JAVA but nothing for ABAP.
Thanks
MeenalHi Meenal,
Please see a post by Sanjay Agarwal titled 'Sequencing Problem in Web Dynpro ABAP'. I believe you will find your answer there.
Cheers,
Rich -
How to read Adapter Parameters at run time
Hi All,
We want to write a adapter module that reads the Adapter type and the file name which the adapter picks up, directly from Adapter parameters at runtime and then our adapter module which is being used in the receiver adapter would read these parameters and use them for further processing.
Now the question is how to read the adapter type and the file name that the sender adapter picks up? I am sure a adapter module is being used internally by SAP that holds these parameters, but which internal adapter module does this and how to access it's parameters so that we can use them in our scenario.
Regards,
XIer
Edited by: XIer on Jan 9, 2008 12:36 AMCheck the file adapter FAQ. There is a SAP note with the file adapter FAQ that descirbes how the filename can be read with in a module.
The code looks like something like this,
Hashtable mp =
(Hashtable) inputModuleData.getSupplementalData(
"module.parameters");
String strFileName = "";
strFileName = (String) mp.get("FileName");
Regards
Bhavesh -
How to read URL parameters of one wdp component into other WDP component?
Dear Experts,
Can anyone let me know how to read URL parameters of one wdp component into other WDP component?
My requirement is i have one standard WDP component with 3 URL parameters and i needto
read that URL parameters along with their values in my Z-WDP component.
Thanks
SKHi Santosh,
You can read parameters send from one WebDynpro Component to another component by adding code in "HANDLEDEFAULT" Event Handler method ( Window )of your target Web Dynpro Component.
data: lt_parameter type tihttpnvp,
ls_parameter type ihttpnvp.
lo_api_controller ?= wd_this->wd_get_api( ).
call method lo_api_controller->get_message_manager
receiving
message_manager = lo_message_manager.
clear : ls_parameter.
refresh : lt_parameter[].
* Read all URL parameters
wdevent->get_data( exporting name = if_wd_application=>all_url_parameters importing value = lt_parameter ).
if not lt_parameter[] is initial.
clear : ls_parameter.
read table lt_parameter into ls_parameter index 1.
if ls_parameter-name = 'ACTION' and
ls_parameter-value is initial.
lv_flag = 'X'.
clear : lo_msg.
lo_msg = 'Action Parameter Missing in URL Link !'.
* report message
call method lo_message_manager->report_error_message
exporting
message_text = lo_msg.
else.
endif.
Best Regards
Priyesh Shah -
Reading URL parameters in ABAP webdynpro
I have a requirements to run my ABAP Webdynpro application view based on two parameters passed to it from portal. How can I read the parameters in ABAP webdynpro and use them to write my condition in the run time. I would appreciate it if someone has any code that would help me also.
Again your help and support is highly appreciated.
LilyHi Lily,
To read the URL parameters, you need to right the following code in the HANDLEDEFAULT method
of the your default window controller.
DATA : it_parameter TYPE tihttpnvp,
wa_parameter TYPE ihttpnvp.
DATA lo_nd_url_param TYPE REF TO if_wd_context_node.
DATA ls_url_param TYPE wd_this->element_url_param.
" Get all URL parameters
CALL METHOD wdevent->get_data
EXPORTING
name = if_wd_application=>all_url_parameters
IMPORTING
value = it_parameter.
" Get parameter values
CLEAR wa_parameter.
READ TABLE it_parameter WITH KEY name = 'PERNR' INTO wa_parameter.
IF sy-subrc EQ 0.
ls_url_param-pernr = wa_parameter-value.
ENDIF.
CLEAR wa_parameter.
READ TABLE it_parameter WITH KEY name = 'SUBTY' INTO wa_parameter.
IF sy-subrc EQ 0.
ls_url_param-subty = wa_parameter-value.
ENDIF.
CLEAR wa_parameter.
READ TABLE it_parameter WITH KEY name = 'BEGDA' INTO wa_parameter.
IF sy-subrc EQ 0.
ls_url_param-begda = wa_parameter-value.
ENDIF.
CLEAR wa_parameter.
READ TABLE it_parameter WITH KEY name = 'ZZPRNTOPT' INTO wa_parameter.
IF sy-subrc EQ 0.
ls_url_param-zzprntopt = wa_parameter-value.
ENDIF.
" Save URL parameter to context
lo_nd_url_param = wd_context->get_child_node( name = wd_this->wdctx_url_param ).
lo_nd_url_param->set_static_attributes(
static_attributes = ls_url_param ).
Regards,
Vikrant -
Hi All,
How to read URL parameters in another WDA.
Thanks in advancehere is the sample code.
you can write this code in HANDLEDEFAULT method of Default Window of Application being called.
DATA:
wa_url TYPE LINE OF tihttpnvp,
int_url TYPE tihttpnvp.
wdevent->get_data(
EXPORTING
name = if_wd_application=>all_url_parameters
IMPORTING
value = int_url ). -
Hi All ;
I have problem with read text parameters.
Now Im using the parameters like below;
name = belnr + gjahr + buzei
call function 'READ_TEXT'
exporting
client = sy-mandt
id = '01'
language = sy-langu
name = name
object = 'AKKP'
tables
lines = tab_line[]
But I want to add bukrs to the name variable like that;
name = bukrs + belnr + gjahr + buzei
If I use the name parameter with bukrs the read_text function doesnt work.
Could you help about that ?
Regards
FırtınaHello Yigit ,
Add zeros to bukrs , belnr , gjahr and buzei and concatenate into name.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
INPUT = bukrs
IMPORTING
OUTPUT = bukrs
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
INPUT = belnr
IMPORTING
OUTPUT = belnr..
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
INPUT = gjahr
IMPORTING
OUTPUT = gjahr.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
INPUT = buzei
IMPORTING
OUTPUT = buzei.
Concatenate bukrs belnr gjahr buzei into name.
Please pass NAME filed to the READ_TEXT FM.
Thanks -
"Master Data Read Class Parameters" field is disabled
Hi.
While creating infoobject I switch master data access from Default to Own implementation,
after this screen is redisplayed and only Name of Master Data Read Class field become enabled.
I need Master Data Read Class Parameters field, but it is disabled and button near this field has the same status.
Why? How to make them active?Hi,
I think it is not possible to add own Master Data Class if the reference is 0DATE or if the type is DATS.
So may be you can create your infoobject as Type CHAR, Length 8.
May be you can add a Conversion Routine for the required format of date to be displayed. -
Need Read URL parameters from Adobe from
Hi all,
I have a specific application where in i need to read the parameters of the iview URL from an adobe form. The adobe form is a stand alone adobe form in KM. Its not developed using netweaver developer studio.
It would of very major help if some one can help me in this regard. Any javascript or formcalc to read iview URL parameters from an adobe form would be of great help.
Thanks in advance.
regards,
Deepthi lakshmi.A.See http://forums.adobe.com/thread/1279496
-
Hi guys!
Is posible read url parameters from a WD for Java?
e.g.: http://server/webdynpro/dispatcher/local/TestApp/TestApp?SAPtestId=1&myVariable=123
Then read value 123 from some code inside WD (controller, view, whatever).
Thanks!Hi,
You can do it, see this reference: Pass URL parameters to SAP Portal from an external application
Best regards -
Custom SICF handler read URL parameters
Hello,
I have written a custom SICF handler.In the SICF handler method of handle request,how do i read URL parameters.
regards
KaushikHi,
Using GET_HEADER_FIELD() / GET_HEADER_FIELDS(), the HTTP request handler can access all attributes of the HTTP header (name/value pairs).
Refer Accessing Header Fields (SAP Library - Components of SAP Communication Technology)
Regards,
Chandra -
Applet.getParameter fails to read all parameters
I have an applet that fails to read all the parameters (using the getParameter method) provided to it with PARAM tags. Eventually I realised that the cause was a tag:
<param name="1.mpname" value="x">
Not only could this parameter not be read, but getParameter couldn't read any parameters that came after this (in the HTML code) either. I realise starting a parameter name with a non-alphabetic character is a bit silly, but I'm writing this to conform to a W3C specification so I don't have much choice in the matter.
Can anyone else confirm this problem? Is there a workaround?
Thanks,
Richard 'Tony' GooldThe HTML is:
<OBJECT
height=20
width=20
classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
codebase="http://java.sun.com/products/plugin/1.3/jinstall-13-win32.cab#Version=1,3,0,0">
<PARAM NAME=ARCHIVE VALUE="MicroproductLinkSigned.jar">
<PARAM NAME=CODE VALUE="com/inexum/Nickel/MicroproductLink/PerFeeLinkHandler.class">
<PARAM NAME=TYPE VALUE="application/x-java-applet;version=1.3">
<PARAM NAME=SCRIPTABLE VALUE="false">
<PARAM NAME="price" VALUE="0.05USD">
<PARAM NAME="textlink" VALUE="Product.html">
<PARAM NAME="requesturl" VALUE="http://rgoold:8080/servlet/com.inexum.Nickel.Merchant.PurchaseServlet">
<PARAM NAME="1.mpname" VALUE="http://www.inexum.com/">
<PARAM NAME="1.mpurl" VALUE="http://www.inexum.com/">
<PARAM NAME="title" VALUE="Product1">
<PARAM NAME="duration" VALUE=200>
<PARAM NAME="longdesc" VALUE="Music - Artist=Alpha Song=Beta"
<PARAM NAME="mpRMI" VALUE="//rgoold/Merchant">
<PARAM NAME="buyid" VALUE="zxcvbnm">
</OBJECT>And the code is just a series of calls to getParameter, e.g.,
String price = getParameter("price");
String requestURL = getParameter("requesturl");
String svc1 = getParameter("1.mpname");
String title = getParameter("title");But any of the parameters that come after 1.mpname (the first invalid parameter name) in the HTML code are not picked up. So in the example I've given, "title" would return null. If I move the title PARAM tag to before 1.mpname, my getParameter call picks it up. I'm assuming the Applet class just throws an exception parsing PARAM tags and stops after the first invalid one.
I'm using IE 5.5 on Windows 2000 to test this out. -
Read Scripting Parameters within a Filter
Hello,
I'd like to have a Plug In which can read Scripting Parameters and run accordignly.
One of the code samples in the SDK is called "PoorMansTypeTool".
In its documentation it is said to be able to "Read scripting parameters".
I look into its code yet I couldn't figure how it does it.
Let's say I have a script with a variable 'a'.
The script launches a filter from the filter lists and want to pass the valu of the parameter 'a' to the filter.
How could that be done?
Are there any constraints on the parameter type, size, etc?
Has anyone tried it before?
If someone could guide me through the plug in code I'd be happy.
Thank You.// make this a function so we can hide these from harness script
main();
function main() {
// Save the current preferences
var startRulerUnits = preferences.rulerUnits;
var startTypeUnits = preferences.typeUnits;
var startDisplayDialogs = displayDialogs;
// Set Photoshop to use pixels and display no dialogs
preferences.rulerUnits = Units.PIXELS;
preferences.typeUnits = TypeUnits.PIXELS;
displayDialogs = DialogModes.NO;
// make this stuff controlled by the harness
var maxTime = 1 * 60;
var iterations = 5;
var percIncrease = 20;
var timeIt = new Timer();
var tests = 0;
var errors = 0;
var eArray = new Array();
var dissolveLog = new File( "~/Desktop/Dissolve.log" );
dissolveLog.open( "w", "TEXT", "????" );
dissolveLog.writeln( "width,\theight,\tdepth,\tpercent,\tdoc create time,\tdissolve time" );
var maxWidth = 30000;
var minWidth = 256;
var incWidth = parseInt( (maxWidth - minWidth) / iterations );
if ( incWidth == 0 )
incWidth = 1;
var maxHeight = 30000;
var minHeight = 256;
var incHeight = parseInt( (maxHeight - minHeight) / iterations );
if ( incHeight == 0 )
incHeight = 1;
// start clean
while (documents.length) {
activeDocument.close(SaveOptions.DONOTSAVECHANGES);
var d = BitsPerChannelType.EIGHT;
for ( var w = minWidth; w < maxWidth; w += incWidth ) {
for ( var h = minHeight; h < maxHeight; h += incHeight ) {
try {
var timeImport = new Timer();
if ( d == BitsPerChannelType.EIGHT )
d = BitsPerChannelType.SIXTEEN;
else
d = BitsPerChannelType.EIGHT;
app.documents.add(UnitValue(w, "px"), UnitValue(h,"px"), undefined, "Dissolve Test", undefined, undefined, undefined, d);
timeImport.stop();
if ( activeDocument.width != w )
error++; // alert( activeDocument.width + ", " + w );
if ( activeDocument.height != h )
error++; // alert( activeDocument.height + ", " + h );
if ( d == 16 && activeDocument.bitsPerChannel != BitsPerChannelType.SIXTEEN )
error++; // alert( activeDocument.bitsPerChannel + ", " + d );
if ( d == 8 && activeDocument.bitsPerChannel != BitsPerChannelType.EIGHT )
error++; // alert( activeDocument.bitsPerChannel + ", " + d );
if ( activeDocument.bitsPerChannel == BitsPerChannelType.ONE )
error++; // alert( activeDocument.bitsPerChannel + ", " + d );
FitOnScreen(); // this makes everything really slow
var historyState = activeDocument.activeHistoryState;
for ( var dPerc = 0; dPerc <= 100; dPerc += percIncrease ) {
tests++;
var timeDissolve = new Timer();
Dissolve(dPerc);
timeDissolve.stop();
// WaitForRedraw(); // guess what this does to our slowness ness er
dissolveLog.write(w + ",\t" + h + ",\t" + d + ", " + dPerc );
dissolveLog.writeln(",\t" + timeImport.getTime() + ", " + timeDissolve.getTime() );
WaitForRedraw();
activeDocument.activeHistoryState = historyState;
if ( timeIt.getElapsed() > maxTime ) {
w = maxWidth + 1;
h = maxHeight + 1;
dPerc = 101;
catch(e) {
alert(e + ":" + e.line);
if ( e.message.search(/cancel/i) != -1 ) {
w = maxWidth + 1;
h = maxHeight + 1;
eArray[eArray.length] = e;
errors++;
// debugger;
} // end catch
} // end for height
} // end for width
dissolveLog.writeln( errors + " errors. " + tests + " tests in " + timeIt.getElapsed() + " seconds. " + tests/timeIt.getElapsed() + " tests/sec.");
dissolveLog.close();
dissolveLog.execute();
// end clean
while (documents.length) {
activeDocument.close(SaveOptions.DONOTSAVECHANGES);
// Reset the application preferences
preferences.rulerUnits = startRulerUnits;
preferences.typeUnits = startTypeUnits;
displayDialogs = startDisplayDialogs;
// 1) " FAIL" for failures
// 2) " PASS" for test results OK
// 3) " BUG" for known bugs, have the file name give the bug number
// 4) "ERROR" this comes from the harness if the script barfed/exception,
return errors == 0 ? ' PASS' : ' FAIL';
} // end function main
Function WaitForRedraw
Usage: Use it to force Photoshop to redraw the screen before continuing
Example:
WaitForRedraw();
function WaitForRedraw() {
var keyID = charIDToTypeID( "Stte" );
var desc = new ActionDescriptor();
desc.putEnumerated( keyID, keyID, charIDToTypeID( "RdCm" ) );
executeAction( charIDToTypeID( "Wait" ), desc, DialogModes.NO );
// WaitNSeconds, slow the script down so you can watch and figure out issues
function WaitNSeconds(seconds) {
startDate = new Date();
endDate = new Date();
while ((endDate.getTime() - startDate.getTime()) < (1000 * seconds))
endDate = new Date();
// FitOnScreen, fits the document and redraws the screen
function FitOnScreen() {
var id45 = charIDToTypeID( "slct" );
var desc7 = new ActionDescriptor();
var id46 = charIDToTypeID( "null" );
var ref1 = new ActionReference();
var id47 = charIDToTypeID( "Mn " );
var id48 = charIDToTypeID( "MnIt" );
var id49 = charIDToTypeID( "FtOn" );
ref1.putEnumerated( id47, id48, id49 );
desc7.putReference( id46, ref1 );
executeAction( id45, desc7, DialogModes.NO );
// Dissolve, given a percentage
function Dissolve( dPercent ) {
var id18 = stringIDToTypeID( "d9543b0c-3c91-11d4-97bc-00b0d0204936" );
var desc3 = new ActionDescriptor();
var id19 = charIDToTypeID( "Amnt" );
var id20 = charIDToTypeID( "#Prc" );
desc3.putUnitDouble( id19, id20, dPercent );
var id21 = charIDToTypeID( "disP" );
var id22 = charIDToTypeID( "mooD" );
var id23 = charIDToTypeID( "moD1" );
desc3.putEnumerated( id21, id22, id23 );
executeAction( id18, desc3, DialogModes.NO );
// DissolveOld, our old scripting params was this
// an interesting test would be to see the old plug-in vs the current one
function DissolveOld( dPercent ) {
var id12 = charIDToTypeID( "disS" );
var desc3 = new ActionDescriptor();
var id13 = charIDToTypeID( "Amnt" );
var id14 = charIDToTypeID( "#Prc" );
desc3.putUnitDouble( id13, id14, dPercent );
var id15 = charIDToTypeID( "disP" );
var id16 = charIDToTypeID( "mooD" );
var id17 = charIDToTypeID( "moD1" );
desc3.putEnumerated( id15, id16, id17 );
executeAction( id12, desc3, DialogModes.NO );
// Library for timing things in JavaScript
function Timer() {
// member variables
this.startTime = new Date();
this.endTime = new Date();
// member functions
// reset the start time to now
this.start = function () { this.startTime = new Date(); }
// reset the end time to now
this.stop = function () { this.endTime = new Date(); }
// get the difference in milliseconds between start and stop
this.getTime = function () { return (this.endTime.getTime() - this.startTime.getTime()) / 1000; }
// get the current elapsed time from start to now, this sets the endTime
this.getElapsed = function () { this.endTime = new Date(); return this.getTime(); }
// end Dissolve.jsx -
Bug? Optional Crystal Parameters in InfoView if R3 is connected!
Hi There,
in another [thread|Re: Optional Crystal Parameters aren't optional in InfoView; we tested a lot with optional crystal parameters in InfoView. I created two similar reports, one is connected to oracle, the other is connected to SAP R3 Infosets and Tables. If i create an optional input-parameter with a standard-value for the report it works fine (and optional). I've also created a "if (hasvalue) then else condition" when the user deletes the standard value and does not enter a value then. Everything works perfect as long as a oracle database is connected.
If i try to do the same connected to a R3 Table or a R3 Infoset, the parameter is not optional, the standard value is missing and due to this, i cannot test the "if (hasvalue) then else condition" because i cannot run the report without a parameter.
All this happens only in InfoView. If you run it directly in crystal, everything works fine...
I think i've found a Bug.
Colleagues told me that there should be similar problems when you try to connect a BW Query...
Thanks
SebastianIs there anybody out there who can also test this issue ?
Thanks
Sebastian
p.s. Please also check this Thread: [Re: Optional Crystal Parameters aren't optional in InfoView|Re: Optional Crystal Parameters aren't optional in InfoView]
Edited by: smenzl on May 27, 2010 4:53 PM
Maybe you are looking for
-
Document change/display - Profit Center / Cost center name
Hi, We have a requirement where client wants to display the profit center and cost center names (short or long) when displaying or changing a parked or a posted document. As we all know SAP shows only the profit center and cost center code and not th
-
I have been importing my cds tonight and then after about 5 cds it will not accept anymore. every disc I place in, it will kick out in about a minute. Then I tried a blu ray, yep, kicked it out, then I tried a dvd, and kicked it out. any suggestio
-
Where are the Web Galleries????
I must be missing something here.. I can publish a web gallery fine from within iPhoto, but doesn't it put the index page and gallery page into iWeb somewhere? I have a link to a gallery, but it has no relation to my iWeb website. This can't be how i
-
How do I have my newest messages appear in apple mail on my iPad without...
How do I have my newest messages appear in apple mail on my iPad without having to scroll up each time
-
When I use any app other than the included camera app to take a photo there is no thumbnail when I import them to my computer with Adobe Elements Uploader or open the folder to my iphone and view them in the folder. Older photo thumbnails are there b