Page 1 of 2
Q:abute varible & Query Builder in stimulsoft
Posted: Sat Feb 19, 2011 11:30 pm
by showki
Hello all
please provide me a sample for passing a parameter of type datetime to the stimulsoft report, i am using the query in the .mrt file itself.
I am able to pass variable as parameter to .mrt file, it is working for all data type exept datetime.
Thanks in advanced
Q:abute varible & Query Builder in stimulsoft
Posted: Mon Feb 21, 2011 1:55 am
by Alex K.
Hello,
You can use the following code:
Code: Select all
DateTime dTime = new DateTime(2010, 02, 21);
report.Dictionary.Variables["DateTimeVariable1"].ValueObject = dTime;
Thank you.
Q:abute varible & Query Builder in stimulsoft
Posted: Mon Feb 21, 2011 2:27 am
by showki
Hello
Thank you Aleksey for you reply.
I want query that make me able to pass datetime variable from stimulsoft to sqlserver.
Thank you.
Q:abute varible & Query Builder in stimulsoft
Posted: Mon Feb 21, 2011 2:36 am
by Alex K.
Hello,
Sorry, maybe we did not exactly understand your question. Could you explain your issue in more details?
Thank you.
Q:abute varible & Query Builder in stimulsoft
Posted: Mon Feb 21, 2011 2:49 am
by showki
ok thank you
I use this's function from asp to report stimulsoft
private void DisplayReport()
{
if (Request.QueryString["ReportName"] != null)
{
reportName = Convert.ToString(Request.QueryString["ReportName"]);
}
else
{
return;
}
lblSelectedreport.Text = reportName;
Session["Reportdt"] = (DataTable)dt;
string reportPath = Server.MapPath(@"./Reports/") + reportName;
Session["ReportPath"] = reportPath;
StiReport report = new StiReport();
report.Load(Server.MapPath(@"./Reports/") + reportName);
report.Dictionary.Databases.Clear();
string connectionString = ConfigurationManager.ConnectionStrings["constring"].ConnectionString.ToString();
report.Dictionary.Databases.Add(new StiSqlDatabase("Connection", connectionString));
((StiText)report.Pages["Page1"].GetComponents()["Variable1"]).Text.Value = txtStartdate.Text;
((StiText)report.Pages["Page1"].GetComponents()["Variable2"]).Text.Value = txtExpirydate.Text;
report.Compile();
StiWebViewer1.Report = report;
}
I want to use the query between (Variable1 and Variable2) in the stimulsoft
Thanks again
Q:abute varible & Query Builder in stimulsoft
Posted: Mon Feb 21, 2011 2:01 pm
by Alex K.
Hello,
If we understood your question correctly, you can create 2 variables in a report, which are used in the query
Code: Select all
SELECT * FROM TABLE WHERE COLUMN BETWEEN {Variable1} AND {Variable2}
And pass values of these variables from the code
Thank you.
Q:abute varible & Query Builder in stimulsoft
Posted: Tue Feb 22, 2011 12:12 am
by showki
Thank you very much
Q:abute varible & Query Builder in stimulsoft
Posted: Tue Feb 22, 2011 12:39 am
by Alex K.
Hello,
We are always glad to help you!
Let us know if you need any additional help.
Thank you.
Q:abute varible & Query Builder in stimulsoft
Posted: Tue Feb 22, 2011 2:45 am
by showki
Hello Aleksey
I am pleased and honored your interlocutor again
I ask forgiveness and a big thanks to you from me
Can send an example to display the data between two dates, because I tried to Carry out the code I can not
I've got two dates I do first of the program and then I send dates to the report and there is data is displayed depending on the dates sent
Please send example fully
Wait for your answer my teacher Mr.
Note
I am use a language asp and charp
thank you
Q:abute varible & Query Builder in stimulsoft
Posted: Tue Feb 22, 2011 8:56 am
by Alex K.
Hello,
When you use the DateTime type in the query with the Between construction, the date should be in the 'YYYYMMDD' format. Otherwise, you need to write a converter that will convert the date to your desired format.
Thank you.