convert parameter to int in Stimulsoft mrt

You can use standard C# function in Stimulsoft .MRT report although I have not seen them in documents as such. For example if you want to add two parameter values in Stimulsoft MRT Report, you will have to convert them to integer first. By default they are of “Object” type. In the following example, I am converting @Month object into an integer. It must first be converted to string using ToString() and then use Int32.Parse() function to convert it.

This variable can then be added to another variable (concatenation) as Int32.Parse(DataSource1.Parameters[“@num1”].ParameterValue.ToString()) + Int32.Parse(DataSource1.Parameters[“@numb”].ParameterValue.ToString())

Read More

How to enable disable a page in Stimulsoft

Stimulsoft allows you to enable/disable a page based on a parameter. For example you want to print one type receipt for one department and another type of receipt for another department, you can do that by creating two pages and enable/disable each page based on a paramater in this case department ID. In my case, I am passing a parameter name @page. If if pass 1, it hides page 1 and show only page 2 (no condition is given to page). DataSource1.Parameters[“@page”].ParameterValue.ToString()==”1″ Help on the same topic from Stimulsoft

Read More

Stimulsoft Report Multiple Queries with different Parameters

Lets say I have two queries in my stimulsoft (.mrt) report.

In Stimulsoft Report for this to work correct, Query1 which takes 3 arguments must come first than Query2, for the report to work correct. You can move Query (DataSource) up and own by selecting the query first and the click up and own arrow at the top. How to troubleshoot your Stimulsoft Report The most common scenario that you will have to troubleshoot is are parameters passed correctly the queries? To do that simply drag all parameters from the queries on to the report area, one in each…

Read More

Decimal value is automatically rounded off in Stimulsoft Fixed

I had a database field Qty which which was showing as integer in Stimulsoft MRT report but the value was actually of type double (decimal value). I played with formatting and added two decimal places to the number by right clicking the field and selecting “Text Format”. That added decimals but now the numbers were showing as 2.00, 5.00 etc. For example, 1.35 would be showing as 1.00 and 3.6 would be showing as 4.00. It turned out that I needed to change the data type in Stimulsoft SQL query. To fix it, right click on the database field in…

Read More

Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index Stimulsoft

When you run your query, it might run just find but in your stimulsoft report you might get this error. The error could arise from mismatch of parameter or parameter not giving in the URL or too many parameters given. In my case the error was really dump. I was referencing a report that did not exists. That is my report was refering to report1new.mrt which did not exist. I should have been referring to report1.mrt instead. After fixing this error went away. Hope it helps someone else! A simple spelling mistake!

Read More