Crystal Reports Viewer shows a blank report on the production server but works on the development server.
The report was displaying fine and then it started to display a blank screen. This is the only thing that worked since crystal reports didn't show an error message or any other sign. I downloaded the latest version from the SAP website:
http://scn.sap.com/docs/DOC-7824
An interesting note is that the references show a version Version=13.0.2000.0
but it was really version 13.0.9.1312. This was confusing and had me trying to uninstall and clear out the 13.0.2
Possible Solution:
Copy the folder aspnet_client to the root of your application on the server.
My Web.config file has the following:
<?xml version="1.0"?>
<configuration>
<configSections>
<sectionGroup name="businessObjects">
<sectionGroup name="crystalReports">
<section name="crystalReportViewer" type="System.Configuration.NameValueSectionHandler"/>
</sectionGroup>
</sectionGroup>
</configSections>
<appSettings>
<add key="CrystalImageCleaner-AutoStart" value="true" />
<add key="CrystalImageCleaner-Sleep" value="60000" />
<add key="CrystalImageCleaner-Age" value="120000" />
</appSettings>
<businessObjects>
<crystalReports>
<crystalReportViewer>
<add key="UseBrowserLocale" value="true"/>
<add key="resourceURI" value="~/aspnet_client/system_web/4_0_30319/crystalreportviewers13"/>
</crystalReportViewer>
</crystalReports>
</businessObjects>
<system.web>
<httpHandlers>
<add verb="GET" path="CrystalImageHandler.aspx" type="CrystalDecisions.Web.CrystalImageHandler, CrystalDecisions.Web, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/>
</httpHandlers>
<compilation debug="true">
<assemblies>
<add assembly="CrystalDecisions.Web, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>
<add assembly="System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="CrystalDecisions.Shared, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>
<add assembly="System.Web.Services, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>
<add assembly="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="System.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="CrystalDecisions.ReportSource, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>
<add assembly="System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="CrystalDecisions.ReportAppServer.Controllers, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>
<add assembly="CrystalDecisions.ReportAppServer.DataDefModel, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>
<add assembly="CrystalDecisions.CrystalReports.Engine, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692FBEA5521E1304"/>
<add assembly="CrystalDecisions.ReportAppServer.ClientDoc, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/></assemblies>
</compilation>
</system.web>
<system.webServer>
<validation validateIntegratedModeConfiguration="false"/>
<handlers>
<add name="CrystalImageHandler.aspx_GET" verb="GET" path="CrystalImageHandler.aspx" type="CrystalDecisions.Web.CrystalImageHandler, CrystalDecisions.Web, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" preCondition="integratedMode"/>
</handlers></system.webServer>
</configuration>
Tuesday, July 8, 2014
C# Optional Arguments
How do you implement optional arguments or parameters in c#?
An easy way to do this is:
public boolean isValidFName(string FName, int MinLength = 0)
{
if (FName.Length == 0 || FName.Length < MinLength)
return false;
else
return true;
}
if (isValidFName(txtFName.Text))
{
//Only checks that the first name is not length 0.
}
if (isValidFName(txtFName.Text, 5))
{
//Checks that the first name is at least length of 5.
}
An easy way to do this is:
public boolean isValidFName(string FName, int MinLength = 0)
{
if (FName.Length == 0 || FName.Length < MinLength)
return false;
else
return true;
}
if (isValidFName(txtFName.Text))
{
//Only checks that the first name is not length 0.
}
if (isValidFName(txtFName.Text, 5))
{
//Checks that the first name is at least length of 5.
}
Monday, November 25, 2013
Unrecognized tag prefix or device filter 'asp'
SOLVED FINALLY!!!
I kept receiving the warning. Unrecognized tag prefix or device filter 'asp' in my Visual Studio 2012, 2013.
I tried deleting everything in the bin directory, obj directory, deleting the suo file and the same thing. Nothing worked. I then realized that this WAS using master pages and I just had removed the content tags so that I could test right away.
When I put the standard html in the index.aspx page like so, everything was able to build fine.
<html>
<head>
<title></title>
</head>
<body>
My Code block here
</body>
</html>
I kept receiving the warning. Unrecognized tag prefix or device filter 'asp' in my Visual Studio 2012, 2013.
I tried deleting everything in the bin directory, obj directory, deleting the suo file and the same thing. Nothing worked. I then realized that this WAS using master pages and I just had removed the content tags so that I could test right away.
When I put the standard html in the index.aspx page like so, everything was able to build fine.
<html>
<head>
<title></title>
</head>
<body>
My Code block here
</body>
</html>
Monday, March 18, 2013
Convert String Date to SQL Date
If you need to convert a date that is in a string format:
03/18/13
into a SQL Server Date so that you can process it, ORDER BY, etc.. then do the following:
CAST(HIRE as Datetime)
where HIRE is a date in string format. If you want to display the date in a particular format, then just CONVERT it to the format you want:
CONVERT(CHAR(10),CAST(HIRE as Datetime),101) as Hire_Date
The CHAR(10) saves space for 10 characters and the 101 is one of the formats available. I didn't use VARCHAR because the field is exactly 10 characters. See the link below for a format you want to use if you don't like the 101 format (mm/dd/yyyy)
http://msdn.microsoft.com/en-us/library/ms187928.aspx
03/18/13
into a SQL Server Date so that you can process it, ORDER BY, etc.. then do the following:
CAST(HIRE as Datetime)
where HIRE is a date in string format. If you want to display the date in a particular format, then just CONVERT it to the format you want:
CONVERT(CHAR(10),CAST(HIRE as Datetime),101) as Hire_Date
The CHAR(10) saves space for 10 characters and the 101 is one of the formats available. I didn't use VARCHAR because the field is exactly 10 characters. See the link below for a format you want to use if you don't like the 101 format (mm/dd/yyyy)
http://msdn.microsoft.com/en-us/library/ms187928.aspx
Sunday, August 26, 2012
Using a Dropdown with Yes No instead of 1 or 0 in a GridView
| Showing Yes or No instead of 1 or 0 in GridView |
You don't have to have another sqldatasource to bind a yes or a no. Try this solution and let me know if this works for you.
<asp:TemplateField HeaderText="YOUR_FIELD" SortExpression="YOUR_FIELD">
<EditItemTemplate>
<asp:DropDownList ID="dropYesNo" runat="server" SelectedValue='<%# Bind("YOUR_FIELD") %>' >
<asp:ListItem Value="0">No</asp:ListItem>
<asp:ListItem Value="1">Yes</asp:ListItem>
</asp:DropDownList>
</EditItemTemplate>
<ItemTemplate>
<%#Eval("YOUR_FIELD").ToString() == "1" ? "Yes" : "No" %>
</ItemTemplate>
<HeaderStyle HorizontalAlign="Center" />
<ItemStyle HorizontalAlign="Center" />
</asp:TemplateField>
Of course, the field that you want needs to be converted to a TEMPLATE FIELD. Let me know if you don't know how to do that and I'll help or post how to.
| Yes or No binds from DropDown |
I use
<%#Eval("YOUR_FIELD").ToString() == "1" ? "Yes" : "No" %>
the EVAL to test if the field is 1 or 0 to show Yes or No in the gridview. I put this in the ItemTemplate.
Also notice,
<asp:ListItem Value="0">No</asp:ListItem>
<asp:ListItem Value="1">Yes</asp:ListItem>
So that your 0 and 1 are written back to your table when you click update.
Happy Coding... :)
Friday, April 13, 2012
YouTube Video Has Green Background
| YouTube Green Screen |
If you play a video on YouTube and all you see is a green screen background but you can hear the audio then you may be able to solve the problem by right-clicking on the video. The Adobe Flash Player Settings will appear on the screen. Click on the 1st icon at the bottom that looks like a monitor (Display), then UN-CHECK the option that says, "Enable hardware acceleration"
Subscribe to:
Posts (Atom)