Wednesday, March 28, 2012
Problem in Crystl Report Viewer.CloseView Method
My Self Sanjeev. i want to ask about crystal report viewer control. i am using crystal report 8.5 version. i using crviewer to view the report. by crviewer.viewreport() i view the reoprt now i want to close the view, so i use crviewer.closeview(index) method but it gives error. index parameter not accepting string data type. and also not 1,-1,0 to close the view. i use activeindex of crviewer but not woking. so please help me to solve this problem. i needed it veru much
SanjeevLooks like something is wrong with dealing with viewObject. Did u use AddView method to add ViewerObject. It's not picking the index properly.
THanks|||hello,
i have not used addview method to add view for the viewobject. how to use it? can u please explain it.
Thankx
Sanjeev|||So far in my application I haven't used view.. it's not clear yet whether I need to use view or not ?
I see this particular function :
closeCurrentView
If the canCloseCurrentView property is True, closes the current view. Equivalent to the Close button in the toolbar. A viewClosed and a viewActivated event are fired. The currentViewName property is changed.
Syntax
void closeCurrentView ()
check whether this server our purpose.
Thanks|||Sorry sir,
this will not solve the problem. i have know that whether the canCloseCurrentView() is method of what? 'coz both the ceviewer and crystalreport is not having property,method,function like this.
and i want to close the view.
sanjeev.|||Do u really need view in your application ? What if you don't close the view ?|||Hello Sir,
I want to create 1 DLL file which includs several reports in it. and i will add reference of that file to my VB Project. So i used Crystal 8.5 and Vb 6.0. i create 1 dll but with ne VB form which have the crystal report viewer control shows the Report which i passed through VB. now when i close the Form of viewer. Dll component does not get closed. i.e. the instance of the object is not closed and project goes into HangUp position. if so i want to close the view first so i can set the object to nothing.
So please help me to di it.
Sanjeev
Monday, March 12, 2012
Problem encountered with Filterparameter on SQLDataSource for GridView
Hi,
I have a GridView connected to a sqldatasource control. Everything is working great, updates, paging and filtering with one exception. When the user enters in a name like O'Reilly (with a single quote), the page errors. The error returned is:
Syntax error: Missing operand after 'Reilly' operator.
Here is the definition of the sqldatasource:
<asp:SqlDataSource ID="SqlDataSourcePersons" runat="server"
ConnectionString="<%$ ConnectionStrings:database %>"
SelectCommand="SELECT [Id], [FirstName], [LastName],, [PersonTypeId], [WorkerId], [_workerNTId], [Title], [City] FROM [Person]"
FilterExpression="(FirstName like '{0}%') AND (LastName like '{1}%') AND (WorkerId like '{2}%') AND (City like '{3}%')" ProviderName="System.Data.SqlClient">
<FilterParameters>
<asp:ControlParameter ControlID="TextBoxFirstName" Name="FirstName" DefaultValue="%" PropertyName="Text" Type="String" />
<asp:ControlParameter ControlID="TextBoxLastName" Name="LastName" DefaultValue="%" PropertyName="Text" Type="String" />
<asp:ControlParameter ControlID="TextBoxWorkerId" Name="WorkerId" DefaultValue="%" PropertyName="Text" Type="String" />
<asp:ControlParameter ControlID="TextBoxCity" Name="City" DefaultValue="%" PropertyName="Text" Type="String" />
</FilterParameters>
</asp:SqlDataSource>
Any suggestions would be appreciated.
Thank you, Jim
Hey
If a filter expression contains reserved characters, such as a single quotation mark, those characters must be specified using escape characters. For example, the following expression shows how to use an escape character to include an apostrophe in the expression:CompanyName = 'Margie\'s Travel'.
Following link might helpful:
http://www.aspnetresources.com/blog/apostrophe_in_rowfilter.aspx
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/vbtskfilteringsortingdatausingdataview.asp