Report compilation error - How to prevent CS file deletion ?
Re: Report compilation error - How to prevent CS file deleti
Hello,
Please try to change the directly sql query instead usisng an additional variable:
((StiSqlSource)report.Dictionary.DataSources["DataSourceName"]).SqlCommand = newSqlCommand;
Thank you.
Please try to change the directly sql query instead usisng an additional variable:
((StiSqlSource)report.Dictionary.DataSources["DataSourceName"]).SqlCommand = newSqlCommand;
Thank you.
Re: Report compilation error - How to prevent CS file deleti
Hello.
What I am trying to do does not allow this.
I want the user to design the report and query and the code to provide only the values that the user cannot insert from the Reports Viewer.
Isn't there a way to achieve what I am trying to do?
Perhaps, changing the old query (SQLCommand) by find-and-replace could do this (if I use a templating mechanism of my own), but I was hoping there was a better solution.
What I am trying to do does not allow this.
I want the user to design the report and query and the code to provide only the values that the user cannot insert from the Reports Viewer.
Isn't there a way to achieve what I am trying to do?
Perhaps, changing the old query (SQLCommand) by find-and-replace could do this (if I use a templating mechanism of my own), but I was hoping there was a better solution.
Re: Report compilation error - How to prevent CS file deleti
Hi again.
I have tried this (after using :varName: as a template):
..and I have managed to pass the list by code.
However, I think it would be nice if you supported this operation by other means.
Thanks.
I have tried this (after using :varName: as a template):
Code: Select all
if (gid != null)
{
var valuesList = string.Join(",", gid);
foreach (var ds in report.Dictionary.DataSources)
{
var sqlSrc = ds as StiSqlSource;
var sql = sqlSrc.SqlCommand;
sqlSrc.SqlCommand = sql.Replace(":varName:", valuesList);
}
}
However, I think it would be nice if you supported this operation by other means.
Thanks.

Re: Report compilation error - How to prevent CS file deleti
Do you have any idea why this MRT causes infinite and identical queries to be sent to the DB?

This seems to happen because I connect the data source on "BeforePrint", but I don't understand under which conditions it does happen and under which it doesn't... 
- Attachments
-
- 21.mrt
- (28.78 KiB) Downloaded 280 times
Re: Report compilation error - How to prevent CS file deleti
Hello,
Can you please send us a test data for your report.
Thank you.
Can you please send us a test data for your report.
Thank you.
Re: Report compilation error - How to prevent CS file deleti
Hello.
I will see if I can give you some more data, but I can't actually share my whole DB.
I won't be easy for me to share much.
It would be nice if we could avoid creating a DB for you to use.
But perhaps this helps:
When changing this query: ...into this: ...the problem appears (infinite and identical queries are being sent to the DB).
The only change to the query is the circled area.
How can this affect your library?
Could the query fail and your library try to re-send the query? (however, I have tried the query in SQL Server and it seems to be working...)
Also, I have noticed this: the query that has the problem, only has problem when I use a parameter @Sender='%%'. If I use a non-empty string like @Sender='%abc%' there is no problem:
No problem here:
For the momment I will try to fix it by changing the query, but it would be great if you could see how can this happen.
I will see if I can give you some more data, but I can't actually share my whole DB.
I won't be easy for me to share much.
It would be nice if we could avoid creating a DB for you to use.
But perhaps this helps:
When changing this query: ...into this: ...the problem appears (infinite and identical queries are being sent to the DB).
The only change to the query is the circled area.
How can this affect your library?
Could the query fail and your library try to re-send the query? (however, I have tried the query in SQL Server and it seems to be working...)
Also, I have noticed this: the query that has the problem, only has problem when I use a parameter @Sender='%%'. If I use a non-empty string like @Sender='%abc%' there is no problem:
No problem here:
Problem appears here:WHERE (dc.IdWorkflow=3 OR dc.IdWorkflow=4) AND (dc.Status=1 OR dc.Status=11) AND
doc.IssueDate>=@FromDate AND doc.IssueDate<=@ToDate AND
ptc.IdOrgGroup=@grpID AND doc.IdDocumentKind IN (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16) AND
COALESCE(dc.Sender,@EmptyStr) LIKE @Sender
ORDER BY doc.IssueDate DESC
',@grpID=1,@FromDate='2009-12-01',@ToDate='2013-12-20',@usrID=1,@Sender='%gj%',@EmptyStr=' '
select @p1
I don't know what is going on here.WHERE (dc.IdWorkflow=3 OR dc.IdWorkflow=4) AND (dc.Status=1 OR dc.Status=11) AND
doc.IssueDate>=@FromDate AND doc.IssueDate<=@ToDate AND
ptc.IdOrgGroup=@grpID AND doc.IdDocumentKind IN (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16) AND
COALESCE(dc.Sender,@EmptyStr) LIKE @Sender
ORDER BY doc.IssueDate DESC
',@grpID=1,@FromDate='2009-12-01',@ToDate='2013-12-20',@usrID=1,@Sender='%%',@EmptyStr=' '
select @p1
For the momment I will try to fix it by changing the query, but it would be great if you could see how can this happen.
Re: Report compilation error - How to prevent CS file deleti
Hello,
Please try to change the name of parameter "Sender".
http://forum.stimulsoft.com/viewtopic.php?f=13&t=37737
Thank you.
Please try to change the name of parameter "Sender".
http://forum.stimulsoft.com/viewtopic.php?f=13&t=37737
Thank you.
Re: Report compilation error - How to prevent CS file deleti
Hi.
Unfortunatelly, that doesn't help.
Now I am trying to reproduce it in a smaller query, but with no luck yet.
Unfortunatelly, that doesn't help.
Now I am trying to reproduce it in a smaller query, but with no luck yet.
Re: Report compilation error - How to prevent CS file deleti
Hello,
Can you please send a smaller query which reproduce the issue for analysis.
Thank you.
Can you please send a smaller query which reproduce the issue for analysis.
Thank you.
Re: Report compilation error - How to prevent CS file deleti
Hello again.
I have limitted the query as much as I could.
I send you some tables and an MRT file.
All you have to do is:
- Create the tables.
- Probably add some random data in the tables.
- Feed the report with all the required variables. Perhaps you could use my previously posted project do test this (I think that was it: http://speedy.sh/7cAat/TestStimulsoft.zip).
If I have missed sth, let me know.
Best Regards,
Kostas
I have limitted the query as much as I could.
I send you some tables and an MRT file.
All you have to do is:
- Create the tables.
- Probably add some random data in the tables.
- Feed the report with all the required variables. Perhaps you could use my previously posted project do test this (I think that was it: http://speedy.sh/7cAat/TestStimulsoft.zip).
If I have missed sth, let me know.
Best Regards,
Kostas
- Attachments
-
- Bug.zip
- (4.85 KiB) Downloaded 271 times