Posts

Showing posts from July, 2012

LINQ to SQL connectionstring pickup from multiple DBML

Image
In Your application if you have more than one DBML file then each DBML file will contain app.config for each DBML file. consider the WPF application






it will be not possible for you to change the client app.config connection string on deployment.
when your application will be ready for deployment take a copy of your solution from your source control. bcoz now you are going to perform many change on your app.config.

1. if you have more than one project then you have change the all project output type as a class library except the start up project.
   right click on the project > properties > change the output as class library




2. Click on setting > right click on the connection string click remove string. if you have more than one then remove all as same.


3. if you have app.xaml . right click and exclude it from project.

4. open your DBML file > right click > properties > expand the connection > select application string as false.





5. Open the DBML cs file on the





chan…

ASP.NET Crystal report Group Tree hide

It's really looking odd that when a crystal report load it also load the group tree. You can easily stop the group tree showing.

aspx :


<CR:CrystalReportViewer ID="secondarySalesCrystalReportViewer" runat="server" EnableDatabaseLogonPrompt="False" EnableParameterPrompt="False" AutoDataBind="true" EnableDrillDown="False" GroupTreeStyle-ShowLines="False" HasCrystalLogo="False" Height="50px" Width="350px" />
and on the page loading  event you have to use:

 secondarySalesCrystalReportViewer.ToolPanelView =CrystalDecisions.Web.ToolPanelViewType.None;


for example



protected void Page_Load(object sender, EventArgs e) { secondarySalesCrystalReportViewer.ToolPanelView = CrystalDecisions.Web.ToolPanelViewType.None; if (!IsPostBack) { secondarySalesCrystalReportViewer.ToolPanelView = CrystalDecis…

ASP.NET Gridview paging in List datasource

Image
In a grid view if the data-source is used a list and the grid view is bind with the class attribute then we can also use paging on the grid view.

consider the gridview image:

the aspx:


<asp:GridView ID="productGridView" runat="server" Width="700px" CellPadding="3" CellSpacing="1" AutoGenerateColumns="False" Height="125px" ForeColor="#333333" AllowPaging="True" GridLines="None" OnSelectedIndexChanged="productGridView_SelectedIndexChanged" onpageindexchanging="productGridView_PageIndexChanging" > <AlternatingRowStyle BackColor="#A99B17" /> <Columns> <asp:BoundField DataField="ProductId" HeaderText="Id" /> <asp:BoundField DataField="ProductCode" HeaderText="Item Code" ItemStyle-Horizont…

ASP.NET Crystal report not showing after publish

Image
1.Right click on your crystal report. go to properties



 2. Change build action properties Embedded Resource to-> Embedded Resource.
Now publish your application you will get your crystal report after publish.

you  can also try this:
Crystal report is not showing after publish, but it show on local PC. may be it the common issue in VS2010 for SAP crystal report. i am not sure about your crystal report error, but here is some possible solution link for your crystal report solution.

http://niitdeveloper.blogspot.com/2012/03/deploy-crystal-report-aspnet.html
http://social.msdn.microsoft.com/Forums/en-CA/vscrystalreports/thread/ef56f72b-7ede-47d8-ba9e-9e63b9ac0203
http://forums.asp.net/t/1764951.aspx/1

if all the link does not solve your problem you can follow this:

1. Put your crystal report in your UI folder.


2. Publish your application


Here you will see one interesting thing that their is no crystal report in your UI folder where you publish the application.
right click on your solution…

Failed to export using the options you specified. Please check your options and try again.

Image
#Solution:1
 in post back just set report loading event as follows btnViewReport_Click(null, null);



protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack == true) { LoadFactoryName(); } else { // Your report viewing button event name btnViewReport_Click(null, null); } }


#Solution:2
You are trying to export the crystal report in PDF or other format.  But it is not working in  VS2010 asp.net SAP crystal report. my this article is not solve the exception but you may can take a alternative way for the solution. you can export the the crystal report in pdf when the report load.

Consider the method it will just load the crystal report

private void LoadDateRangeWiseAllItemDetails() { _secondarySales = new SecondarySales(); _secondarySaleses = new List<SecondarySales>(); _secondarySales.FromDate = Convert.ToDateTime(String.Format(&q…

SAP Crystal report Deployment Environment

In our application if we use SAP crystal report, then after deployment we fall such a problem that we need to install VS2010 and SAP crystal  report 13.0. But there need only a run time crystal report software. here is the link to download you appropriate run time software for deployment PC.

https://wiki.sdn.sap.com/wiki/pages/viewpage.action?pageId=56787567