How pass multiple values to report viewer data-source - visual-studio-2012

I am trying to develop client side report in visual studio 2012. My report is working fine with different selection criteria variables. I am getting error while multi selected list values in filters. passing values as
<SelectParameters>
<asp:FormParameter DefaultValue="0" FormField="ctl00$MainContent$BasicFilterControls$ddlStartHour" Name="StartHour" />
<asp:FormParameter DefaultValue="0" FormField="ctl00$MainContent$BasicFilterControls$ddlStartMinute" Name="StartMinute" />
<asp:FormParameter DefaultValue="2012-11-01" FormField="ctl00$MainContent$BasicFilterControls$txtStartDate" Name="DateFrom" />
<asp:FormParameter DefaultValue="23" FormField="ctl00$MainContent$BasicFilterControls$ddlEndHour" Name="EndHour" />
<asp:FormParameter DefaultValue="59" FormField="ctl00$MainContent$BasicFilterControls$ddlEndMinute" Name="EndMinute" />
<asp:FormParameter DefaultValue="2012-11-01" FormField="ctl00$MainContent$BasicFilterControls$txtEndDate" Name="DateTo" />
<asp:SessionParameter DefaultValue="5027" Name="AgentList" SessionField="AgentList" />
</SelectParameters>
In query in need AgentId as SkillTargetID IN (#AgentList). when I pass single value as 5000 its working fine and showing records. But when I pass multiple values as 5000,5001,5002 etc then got error. Any suggestion to pass multiple values to report viewer.
I had tried with
5000,5001,5002
'5000','5001','5002'
(5000,5001,5002)
('5000'),('5001'),('5002')
I am trying this on visual studio 2012, Sql server 2008 r2 and .net framework 4.5.

Sill I couldn't find any proper solution but I solve my problem by changing DataSource SelectCommand query. On report refresh button_click I just change MyDataSource.SelectCommand query as
string AgentIds = "5000,5001,5002";
MyDataSource.SelectComamnd = "Select * from Agent where AgentId IN ('" + AgentIds + "')";
ReportViewer1.LocalReport.Refresh();
and it works. If anyone find a batter solution to add multiple values to DataSource variable then please update me.

Related

Error adding capability in windows phone app

I am working on a Windows phone app in Visual studio 2012 and finding difficulties showing pub center ads. I have searched that we need to add certain capabilities reference : Windows phone ads not working, I have added all the capabilities but while adding "ID_CAP_MEDIA_LIB" its throws an error
"The Name attribute is Ivalid - The value "ID_CAP_MEDIA_LIB"is Invalid
according to its datatype 'string' - The enumeration constraint
failed."
Any help would be appreciated
Hum this capability doesn't not exit.
<Capability Name="ID_CAP_MEDIALIB_AUDIO" />
<Capability Name="ID_CAP_MEDIALIB_PLAYBACK" />
<Capability Name="ID_CAP_MEDIALIB_PHOTO" />
You need =>
ID_CAP_IDENTIFY_USER
ID_CAP_MEDIALIB_PHOTO
ID_CAP_NETWORKING
ID_CAP_PHONEDIALER
ID_CAP_WEBBROWSERCOMPONENT
You can add an event handler to the Error Event on the AdControl, by catching that or adding a break point and drilling into the error event args you can normally pinpoint what the specific problem is or which capability your app is lacking during development.
As MatDev8 alluded to, it's probably best just to add capabilities through the wpmanifest UI.

How RESTful count property actually work?

I tried to load ONE data column using RESTful viewItemFileService and use it in dojo filtering select control for selection. The total rows is 50,000 and seems that REST could not handle big data because I set count=1000000. If I set count=500, then it works but the rest of data after 500 not available for selection in dojo filtering control. I would like to see RESTful can load data per count size but it seems no doing that. My code as below. I must missing something.
<xe:restService id="restActivity" jsId="activityStore"
pathInfo="activities">
<xe:this.service>
<xe:viewItemFileService viewName="lkpActivities"
dojoType="dojo.data.ItemFileReadStore" var="rowActivity"
contentType="application/json" compact="true" systemColumns="4"
count="1000000">
<xe:this.columns>
<xe:restViewColumn columnName="Activity"
name="Activity">
</xe:restViewColumn>
</xe:this.columns>
</xe:viewItemFileService>
</xe:this.service>
</xe:restService>
<xe:djFilteringSelect id="djfsActivity"
promptMessage="Please type the first letter of intended activity"
invalidMessage="No activity found. Please type again"
searchAttr="Activity" labelAttr="Activity" store="activityStore"
pageSize="20">
</xe:djFilteringSelect>

Get SQL String from Hibernate query

I need to get the string from an Hibernate query and process it later (so I can't solve it with "hibernate.show_sql").
I have already looked at How to get SQL from Hibernate Criteria API (*not* for logging) but with that workaround I get the SQL query string but instead of showing the parameters value it shows '?'... Is there any way to get the full SQL string with the parameters values?
I mean, with that solution I get "SELECT * FROM USER WHERE NAME=? AND SURNAME=?" but I need to get "SELECT * FROM USER WHERE NAME='John' AND SURNAME='Doe'"...
Ideas?
You have to set TRACE level of logging to this hibernate package and parameter binding should show in your application log:
<category name="org.hibernate.type">
<priority value="TRACE"/>
</category>
Output example:
13:58:51,505 DEBUG [SQL]
insert
into
s.audit
(action, e_s, ip, time, userid, id)
values
(?, ?, ?, ?, ?, ?)
13:58:51,505 TRACE [StringType] binding 'Modify user' to parameter: 1
13:58:51,505 TRACE [StringType] binding 'E' to parameter: 2
13:58:51,505 TRACE [StringType] binding '164.20.81.65' to parameter: 3
13:58:51,505 TRACE [TimestampType] binding '2012-07-30 13:58:51' to parameter: 4
13:58:51,505 TRACE [IntegerType] binding '158' to parameter: 5
13:58:51,505 TRACE [IntegerType] binding '8851' to parameter: 6
And don't forget 'hibernate.show_sql=true' property you said previously to show also the related SQL.
There is a tool called p6spy. It's a bit older and I am afraid it isn't maintained anymore. It gave me good results in the past, anyway.
Edit: just found that it is being actively developed again. Works like a charm for me!
There is no such thing as "the full SQL string with the parameters values".
Hibernate uses prepared statements, therefore it sends query string with ?s and parameter values to the database separately, so that the actual query is never constructed.
Perhaps you can find a way extract parameter values from QueryImpl, but even in this case you won't be able to get a query ready for execution, because you'll need to handle escaping, conversion of parameter values to SQL literals, etc.
JdbcLogger does this form you. http://jdbclogger.sourceforge.net/. Supports mysql, postgres, and spring integration.
Another option is to use datasource-proxy which allows to listen to different JDBC events including query execution.
You can implement QueryExecutionListener.beforeQuery that receives QueryInfo with SQL query text and all parameters.

WSO2 - Using get-property() function in Property/Xquery Mediators

Our current service has 7 operations. when writing an outbound xquery "local entry" in wso2, we're trying to retrieve the name of the current operation being executed (how can this be so difficult?).
After reading what i could find in wso2's documentation. it appears as if we need to set up both a Property and an Xquery mediator. supposedly the property mediator would pull the value doing something like get-property('OperationName') and then this would be referenced and passed thru the Xquery mediator.
The other idea was that we needed to define it as a variable in the "Local Registry entry definitions" and than it would be around at all parts of the sequence.
I've tried for 2 days but haven't quite got it.
Please tell me what I'm missing...
Did you try the following xquery sample[1]? I modified the query mediator to get the operation name as follows.
<variable xmlns:ax21="http://services.samples/xsd" xmlns:m0="http://services.samples" name="code" expression="get-property('OperationName')" type="STRING" />
this worked fine. I could see the getQuote in the response message.
[1] http://wso2.org/project/esb/java/4.0.2/docs/samples/advanced_mediation_samples.html#Sample390

SubSonic 2.1 and Oracle problems

Please if anyone knows the answer, I´m still looking for 3 days and nothing..
I make some test with subsonic, SqlServer and MySql and with some little changes in the web.config file everything was good.
But now, I need to work with Oracle . I maked the changes and next command runs
DataTable qry = ModeloDados.DB.Select().From("CARGO").ExecuteDataSet().Tables[0];
But if i type the ModeloDados. the class doesn´t appear. Ony appear the next :
DB , Schemas , SPs , Tables , Views
With the SqlServer or MySql everything is good.The class Cargo appear. I think it´s not configuration in the Oracle because the above command runs, but i need to work with the class
some like Cargo c = new Cargo
But the class doesn´t appear.
There something i missing ?
Thanks for any help.
THE CONFIGURATION :
<connectionStrings>
<add name="oracle" connectionString="Data Source=xxx.x.xx.xx:1521/bancoteste;Persist Security Info=True;User ID=user;Password=xxx;" providerName="System.Data.OracleClient"/>
</connectionStrings>
<SubSonicService defaultProvider="oracle" enableTrace="false" templateDirectory="">
<providers>
<clear/>
<add name="oracle" type="SubSonic.oracleDataProvider, SubSonic"
fixDatabaseObjectCasing="true"
connectionStringName="oracle"
generateRelatedTablesAsProperties="true"
fixPluralClassNames="false"
generatedNamespace="ModeloDados"
regexIgnoreCase="true"
removeUnderscores="false"
setPropertyDefaultsFromDatabase="true"
generateNullableProperties="true"
useExtendedProperties="true" useUtc="true"/>
</providers>
</SubSonicService>
<compilation debug="true">
<buildProviders>
<add extension=".abp" type="SubSonic.BuildProvider, SubSonic"/>
My guess is that there are errors when the build provider runs against Oracle.
You'll need to hunt those down, perhaps by doing a build with SubCommander instead. I haven't used the build provider in a long time, but if memory serves, it's not that great at putting the errors into visual studio where you can see them.

Resources