Open Forum

RIPARAM Doesn't Retrieve ProjectMask

  • 1.  RIPARAM Doesn't Retrieve ProjectMask

    BRONZE CONTRIBUTOR
    Posted 12 days ago
      |   view attached
    I'm creating a brand new Crystal Report (not a modification of an existing SL report) that has a Project ID in it.  I'm trying to add the RIPARAM("ProjectMask") code so that I add the dashes to the project number.  When I run this function I'm getting a long string of asterisks (*********) rather than the mask that a default SL report pulls (@R XX-XX-XXXX-XXX) so never get proper formatting.  Yes, I realize I could just hardcode the mask but I'd prefer to do it with the RIPARAM so that if the mask changes in the future I don't have to come back to the report to update it.

    I'm *guessing* that I need to add a reference of some sort; be it a DLL or a field from a table in order to create the link SL needs to fetch the mask, but so far I haven't stumbled across an answer.  Anyone have any ideas??  Thanks in advance!

    Joe

    PS - Attached is the RIPARAM reference which was a PITA to find, so if anybody wants it, here you go!

    ------------------------------
    Joe Miller
    Director of Systems Architecture
    Harrison, Walker & Harper
    Paris TX
    ------------------------------

    Attachment(s)



  • 2.  RE: RIPARAM Doesn't Retrieve ProjectMask

    SILVER CONTRIBUTOR
    Posted 12 days ago
    Use GRRSW00 as the RunBeforeApplic in the report's RptControl row. That's the "Pre-Process Name" on the Report Control Maintenance (98.300.00) screen.

    ------------------------------
    Jonathan Van Houtte
    Senior Consultant
    XLstatements, LLC
    Clifton Park NY
    ------------------------------



  • 3.  RE: RIPARAM Doesn't Retrieve ProjectMask

    BRONZE CONTRIBUTOR
    Posted 12 days ago
    That fixed it Jon, thanks so much!  Do you know anything about this EXE and it's function?  Is it only for Project related reports?  What do you do if you need a preprocess on a Project related report?  Does that mean your out of luck for the extended RIPARAMs (assuming you don't write an EXE and call GRRSW00 as part of it's execution).

    Thanks for any additional light you can shed.

    Joe

    ------------------------------
    Joe Miller
    Director of Systems Architecture
    Harrison, Walker & Harper
    Paris TX
    ------------------------------



  • 4.  RE: RIPARAM Doesn't Retrieve ProjectMask

    SILVER CONTRIBUTOR
    Posted 12 days ago
    If you're creating the pre-process as an exe using the SDK, then reference the provided AddRIParam API:

    Declare Function AddRIParam Lib "CRPESOL4.DLL" (ByVal RI_ID As Integer, ByVal ID As String, ByVal value As String) As Integer

    Then call that function to populate the added value, e.g.:

    NC = AddRIParam(RI_ID, "ProjectMask", "@R XX-XX-XXXX-XXX")

    This is documented (sort of) in the Reporting Guide.




    ------------------------------
    Jonathan Van Houtte
    Senior Consultant
    XLstatements, LLC
    Clifton Park NY
    ------------------------------



  • 5.  RE: RIPARAM Doesn't Retrieve ProjectMask

    SILVER CONTRIBUTOR
    Posted 12 days ago
    If you want to build that formatting string, try some SQL like:

    SELECT '@R ' + REPLICATE('X',SUBSTRING(control_data,31,2)) +
    CASE WHEN LEFT(control_data,1) > '1' THEN SUBSTRING(control_data,18,1) + REPLICATE('X',SUBSTRING(control_data,70,2)) ELSE '' END +
    CASE WHEN LEFT(control_data,1) > '2' THEN SUBSTRING(control_data,18,1) + REPLICATE('X',SUBSTRING(control_data,109,2)) ELSE '' END +
    CASE WHEN LEFT(control_data,1) > '3' THEN SUBSTRING(control_data,18,1) + REPLICATE('X',SUBSTRING(control_data,148,2)) ELSE '' END +
    CASE WHEN LEFT(control_data,1) > '4' THEN SUBSTRING(control_data,18,1) + REPLICATE('X',SUBSTRING(control_data,187,2)) ELSE '' END +
    CASE WHEN LEFT(control_data,1) > '5' THEN SUBSTRING(control_data,18,1) + REPLICATE('X',SUBSTRING(control_data,226,2)) ELSE '' END
    FROM dbo.PJCONTRL
    WHERE control_type = 'FK' AND control_code = 'PROJECT';

    ------------------------------
    Jonathan Van Houtte
    Senior Consultant
    XLstatements, LLC
    Clifton Park NY
    ------------------------------