Adding Automatic Filters to Crystal Reports Run Through the Infor CRM Web Client

Filed under “when did this get added”.

I just found that in the 8.3.09 Infor CRM system that the Crystal Report “Activities: Current Activities – Sample” when run through the web client acts differently then when run through the LAN client. In the web client it filters down the report to only show current user data, where in the LAN client it shows activities for any users.

I was digging into why this was happening for a client and found that in the Architect, under the Manage/Crystal Reports area, if you right click on a report and click Edit, there is a “new” field under the Execution tab called “Filter Conditions”. For this sample report there is XML markup in there to filter the report using a wildcard for the current user.

The XML markup looks like this:

<SLXReportConditions>
    <MainTable>ACTIVITY</MainTable>
    <SLXCondition>
        <ConditionType>Query</ConditionType>
        <Table>ACTIVITY</Table>
        <Field>USERID</Field>
        <Operator>Is</Operator>
        <Value>:UserID</Value>
        <DataType>STRING</DataType>
        <Connector>OR</Connector>
        <Tag></Tag>
        <FromRange />
        <ToRange />
    </SLXCondition>
    <SLXCondition>
        <ConditionType>Query</ConditionType>
        <Table>USER_ACTIVITY</Table>
        <Field>USERID</Field>
        <Operator>Is</Operator>
        <Value>:UserID</Value>
        <DataType>STRING</DataType>
        <Connector>AND</Connector>
        <Tag></Tag>
        <FromRange />
        <ToRange />
    </SLXCondition>
</SLXReportConditions>

Apparently adding markup here affects only the report running in the Web Client and not the LAN client. For the LAN you would use the When Open hook and a script wired up there, old school style.

In the Architect help file if you search “Example: Filter Conditions XML” you can see an example along with the topic “Report Properties”. Unfortunately zero other documentation can be found on this, but at least this report is an example of its use.

ABOUT THE AUTHOR

Kris Halsrud

Kris Halsrud is a Senior Analyst / Developer for Customer FX Corporation.

2 Comments

  1. Kris,

    I thought I’d contribute a bit to this article because I ran into similar challenges last week over filtering a HISTORY table based report down to the current user only.

    With very little documentation on what the XML markup needs to contain, I did some digging and recalled that the LAN client lets you add custom pre-filters and also has a “VIEW XML” button that shows you what the XML should be with the custom pre-filters added. So I fired up the LAN and generated the XML there, it looked like this:

    HISTORY
    ALL

    User

    =
    Current

    String
    :UserID

    I added it to the Execution tab on the Crystal Report properties….and thought life would be good…..except the report would fail with a HTTP error when run.

    I had to modify the generated XML to the one below.

    HISTORY
    ALL

    User

    =
    :UserID

    String

    Now my report works and pre-filters to the current user.
    Thought I’d share this in case someone else has this issue in the future!

    Reply
    • Anosh, can you email me the XML so I can add it to the blog? Your comment had all of the formatting stripped out.

Submit a Comment

Your email address will not be published. Required fields are marked *

Subscribe To Our Newsletter

Join our mailing list to receive the latest Infor CRM (Saleslogix) news and product updates!

You have Successfully Subscribed!