border: 0
cellspacing: 0
cellpadding: 0
FONT-SIZE: 9pt; MARGIN: 2px 2px 2px 5px; FONT-FAMILY: Arial
SH Programmer - Cornwall
I'm a computer programmer based in Roche, St. Austell, Cornwall with over 7 years of experience in IT. I mostly work with ASP.NET, MS SQL Server and MS Access. This blog contains the knowledge I've gained over the years. Posted mostly as rough notes, I welcome any comments. I hope you might find my blog useful.
Search
Subscribe via email
Thursday, October 21, 2010
formview final formatting
formview formatting
cell width 0% for names of cols
put adjuster label in a row below, width 0%, cell 0%
txtboxes size same as in filter
val summary height 0%
set color and margins of page body document
<body style="color: black;margin-left:0px; margin-top:0px;margin-bottom:0px;margin-right:0px" bgcolor="#000000" >
Reportviewer overlapping on panel and other controls at bottom
Resolved it by adding an invisible label with length adjusted accordingly and making it visible along with the reportviewer.
Autokey primary key column selected as sequence in objectdatasource reportviewer
open dataset1.xsd
edit it
add
<xs:element name="Autokey1" msdata:ReadOnly="true" msdata:Caption="Autokey" msprop:Generator_UserColumnName="Autokey1" msprop:Generator_ColumnPropNameInRow="Autokey1" msprop:Generator_ColumnVarNameInTable="columnAutokey1" msprop:Generator_ColumnPropNameInTable="Autokey1Column" minOccurs="0">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="30" />
</xs:restriction>
</xs:simpleType>
</xs:element>
full listing
<?xml version="1.0" encoding="utf-8"?>
<xs:schema id="DataSet1" targetNamespace="http://tempuri.org/DataSet1.xsd" xmlns:mstns="http://tempuri.org/DataSet1.xsd" xmlns="http://tempuri.org/DataSet1.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:msprop="urn:schemas-microsoft-com:xml-msprop" attributeFormDefault="qualified" elementFormDefault="qualified">
<xs:annotation>
<xs:appinfo source="urn:schemas-microsoft-com:xml-msdatasource">
<DataSource DefaultConnectionIndex="0" FunctionsComponentName="QueriesTableAdapter" Modifier="AutoLayout, AnsiClass, Class, Public" SchemaSerializationMode="IncludeSchema" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
<Connections>
<Connection AppSettingsObjectName="Web.config" AppSettingsPropertyName="Lungar ProjectConnectionString" ConnectionStringObject="" IsAppSettingsProperty="True" Modifier="Assembly" Name="Lungar ProjectConnectionString (Web.config)" ParameterPrefix="@" PropertyReference="AppConfig.System.Configuration.ConfigurationManager.0.ConnectionStrings.Lungar ProjectConnectionString.ConnectionString" Provider="System.Data.SqlClient">
</Connection>
</Connections>
<Tables>
<TableAdapter BaseClass="System.ComponentModel.Component" DataAccessorModifier="AutoLayout, AnsiClass, Class, Public" DataAccessorName="DataTableAdapter" GeneratorDataComponentClassName="DataTableAdapter" Name="Data" UserDataComponentName="DataTableAdapter">
<MainSource>
<DbSource ConnectionRef="Lungar ProjectConnectionString (Web.config)" DbObjectType="Unknown" FillMethodModifier="Public" FillMethodName="Fill" GenerateMethods="Both" GenerateShortCommands="False" GeneratorGetMethodName="GetData" GeneratorSourceName="Fill" GetMethodModifier="Public" GetMethodName="GetData" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="False" UserGetMethodName="GetData" UserSourceName="Fill">
<SelectCommand>
<DbCommand CommandType="Text" ModifiedByUser="True">
<CommandText>SELECT
CONVERT(VARCHAR, (CASE WHEN Autokey IS NULL THEN
(SELECT TOP 1 '' AS Autokey
FROM Data) ELSE Autokey END), 1) AS Autokey,
CONVERT(VARCHAR, (CASE WHEN Province IS NULL THEN
(SELECT TOP 1 '' AS Province
FROM Data) ELSE Province END), 1) AS Province,
CONVERT(VARCHAR, (CASE WHEN District IS NULL THEN
(SELECT TOP 1 '' AS District
FROM Data) ELSE District END), 1) AS District,
CONVERT(VARCHAR, (CASE WHEN Hospital IS NULL THEN
(SELECT TOP 1 '' AS Hospital
FROM Data) ELSE Hospital END), 1) AS Hospital,
CONVERT(VARCHAR, (CASE WHEN Caterer_Name IS NULL THEN
(SELECT TOP 1 '' AS Caterer_Name
FROM Data) ELSE Caterer_Name END), 1) AS Caterer_Name,
CONVERT(CHAR(11), (CASE WHEN Date_of_Entry IS NULL THEN
(SELECT TOP 1 '2/5/1981' AS Date_of_Entry
FROM Data) ELSE Date_of_Entry END), 106) AS Date_of_Entry,
CASE WHEN Date_of_Entry = '01 Jan 1900' THEN
(SELECT TOP 1 '' AS Date_of_Entry
FROM Data) ELSE DATENAME(WEEKDAY, Date_of_Entry) END AS Week,
CONVERT(VARCHAR, (CASE WHEN No_of_Daigs IS NULL
THEN
(SELECT TOP 1 '' AS No_of_Daigs
FROM Data) ELSE No_of_Daigs END), 1) AS No_of_Daigs, CONVERT(VARCHAR, (CASE WHEN Food_Item IS NULL THEN
(SELECT TOP 1 '' AS Food_Item
FROM Data) ELSE Food_Item END), 1) AS Food_Item,
No_of_Rotis,
CONVERT(VARCHAR, (CASE WHEN No_of_Bene_Male IS NULL THEN
(SELECT TOP 1 '' AS No_of_Bene_Male
FROM Data) ELSE No_of_Bene_Male END), 1) AS No_of_Bene_Male, CONVERT(VARCHAR, (CASE WHEN No_of_Bene_Female IS NULL
THEN
(SELECT TOP 1 '' AS No_of_Bene_Female
FROM Data) ELSE No_of_Bene_Female END), 1) AS No_of_Bene_Female, CONVERT(VARCHAR, (CASE WHEN Daily_Cost_Per_Person IS NULL
THEN
(SELECT TOP 1 '' AS Daily_Cost_Per_Person
FROM Data) ELSE Daily_Cost_Per_Person END), 1) AS Daily_Cost_Per_Person, CONVERT(VARCHAR, (CASE WHEN Acc_Exp IS NULL
THEN
(SELECT TOP 1 '' AS Acc_Exp
FROM Data) ELSE Acc_Exp END), 1) AS Acc_Exp
FROM Data
WHERE (Date_of_Entry BETWEEN @Date_of_Entry_From AND @Date_of_Entry_To) OR
(Date_of_Entry IS NULL)</CommandText>
<Parameters>
<Parameter AllowDbNull="True" AutogeneratedName="Date_of_Entry_From" ColumnName="CONVERT (CHAR(11), (CASE WHEN Date_of_Entry IS NULL THEN (SELECT TOP 1 '2/5/1981' AS Date_of_Entry FROM Data) ELSE Date_of_Entry END), 106)" DataSourceName="" DataTypeServer="datetime" DbType="DateTime" Direction="Input" ParameterName="@Date_of_Entry_From" Precision="0" Scale="0" Size="8" SourceColumn="Date_of_Entry" SourceColumnNullMapping="False" SourceVersion="Current">
</Parameter>
<Parameter AllowDbNull="True" AutogeneratedName="Date_of_Entry_To" ColumnName="CONVERT (CHAR(11), (CASE WHEN Date_of_Entry IS NULL THEN (SELECT TOP 1 '2/5/1981' AS Date_of_Entry FROM Data) ELSE Date_of_Entry END), 106)" DataSourceName="" DataTypeServer="datetime" DbType="DateTime" Direction="Input" ParameterName="@Date_of_Entry_To" Precision="0" Scale="0" Size="8" SourceColumn="Date_of_Entry" SourceColumnNullMapping="False" SourceVersion="Current">
</Parameter>
</Parameters>
</DbCommand>
</SelectCommand>
</DbSource>
</MainSource>
<Mappings>
<Mapping SourceColumn="Province" DataSetColumn="Province" />
<Mapping SourceColumn="District" DataSetColumn="District" />
<Mapping SourceColumn="Hospital" DataSetColumn="Hospital" />
<Mapping SourceColumn="Caterer_Name" DataSetColumn="Caterer_Name" />
<Mapping SourceColumn="Food_Item" DataSetColumn="Food_Item" />
<Mapping SourceColumn="Date_of_Entry" DataSetColumn="Date_of_Entry" />
<Mapping SourceColumn="Week" DataSetColumn="Week" />
<Mapping SourceColumn="No_of_Daigs" DataSetColumn="No_of_Daigs" />
<Mapping SourceColumn="No_of_Rotis" DataSetColumn="No_of_Rotis" />
<Mapping SourceColumn="No_of_Bene_Male" DataSetColumn="No_of_Bene_Male" />
<Mapping SourceColumn="No_of_Bene_Female" DataSetColumn="No_of_Bene_Female" />
<Mapping SourceColumn="Daily_Cost_Per_Person" DataSetColumn="Daily_Cost_Per_Person" />
<Mapping SourceColumn="Acc_Exp" DataSetColumn="Acc_Exp" />
<Mapping SourceColumn="Autokey" DataSetColumn="Autokey1" />
</Mappings>
<Sources>
</Sources>
</TableAdapter>
</Tables>
<Sources>
</Sources>
</DataSource>
</xs:appinfo>
</xs:annotation>
<xs:element name="DataSet1" msdata:IsDataSet="true" msdata:UseCurrentLocale="true" msprop:Generator_UserDSName="DataSet1" msprop:Generator_DataSetName="DataSet1">
<xs:complexType>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="Data" msprop:Generator_UserTableName="Data" msprop:Generator_RowDeletedName="DataRowDeleted" msprop:Generator_RowChangedName="DataRowChanged" msprop:Generator_RowClassName="DataRow" msprop:Generator_RowChangingName="DataRowChanging" msprop:Generator_RowEvArgName="DataRowChangeEvent" msprop:Generator_RowEvHandlerName="DataRowChangeEventHandler" msprop:Generator_TableClassName="DataDataTable" msprop:Generator_TableVarName="tableData" msprop:Generator_RowDeletingName="DataRowDeleting" msprop:Generator_TablePropName="Data">
<xs:complexType>
<xs:sequence>
<xs:element name="Autokey" msdata:ReadOnly="true" msdata:AutoIncrement="true" msprop:Generator_UserColumnName="Autokey" msprop:Generator_ColumnVarNameInTable="columnAutokey" msprop:Generator_ColumnPropNameInRow="Autokey" msprop:Generator_ColumnPropNameInTable="AutokeyColumn" type="xs:int" />
<xs:element name="Province" msprop:Generator_UserColumnName="Province" msprop:Generator_ColumnVarNameInTable="columnProvince" msprop:Generator_ColumnPropNameInRow="Province" msprop:Generator_ColumnPropNameInTable="ProvinceColumn" minOccurs="0">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="50" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="District" msprop:Generator_UserColumnName="District" msprop:Generator_ColumnVarNameInTable="columnDistrict" msprop:Generator_ColumnPropNameInRow="District" msprop:Generator_ColumnPropNameInTable="DistrictColumn" minOccurs="0">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="50" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="Hospital" msprop:Generator_UserColumnName="Hospital" msprop:Generator_ColumnVarNameInTable="columnHospital" msprop:Generator_ColumnPropNameInRow="Hospital" msprop:Generator_ColumnPropNameInTable="HospitalColumn" minOccurs="0">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="50" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="Caterer_Name" msprop:Generator_UserColumnName="Caterer_Name" msprop:Generator_ColumnVarNameInTable="columnCaterer_Name" msprop:Generator_ColumnPropNameInRow="Caterer_Name" msprop:Generator_ColumnPropNameInTable="Caterer_NameColumn" minOccurs="0">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="50" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="Food_Item" msprop:Generator_UserColumnName="Food_Item" msprop:Generator_ColumnVarNameInTable="columnFood_Item" msprop:Generator_ColumnPropNameInRow="Food_Item" msprop:Generator_ColumnPropNameInTable="Food_ItemColumn" minOccurs="0">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="50" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="Week" msprop:Generator_UserColumnName="Week" msprop:Generator_ColumnPropNameInRow="Week" msprop:Generator_ColumnVarNameInTable="columnWeek" msprop:Generator_ColumnPropNameInTable="WeekColumn" type="xs:string" minOccurs="0" />
<xs:element name="Date_of_Entry" msdata:ReadOnly="true" msprop:Generator_UserColumnName="Date_of_Entry" msprop:Generator_ColumnPropNameInRow="Date_of_Entry" msprop:Generator_ColumnVarNameInTable="columnDate_of_Entry" msprop:Generator_ColumnPropNameInTable="Date_of_EntryColumn" minOccurs="0">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="11" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="No_of_Daigs" msdata:ReadOnly="true" msprop:Generator_UserColumnName="No_of_Daigs" msprop:Generator_ColumnPropNameInRow="No_of_Daigs" msprop:Generator_ColumnVarNameInTable="columnNo_of_Daigs" msprop:Generator_ColumnPropNameInTable="No_of_DaigsColumn" minOccurs="0">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="30" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="No_of_Rotis" msdata:ReadOnly="true" msprop:Generator_UserColumnName="No_of_Rotis" msprop:Generator_ColumnPropNameInRow="No_of_Rotis" msprop:Generator_ColumnVarNameInTable="columnNo_of_Rotis" msprop:Generator_ColumnPropNameInTable="No_of_RotisColumn" minOccurs="0">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="30" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="No_of_Bene_Male" msdata:ReadOnly="true" msprop:Generator_UserColumnName="No_of_Bene_Male" msprop:Generator_ColumnPropNameInRow="No_of_Bene_Male" msprop:Generator_ColumnVarNameInTable="columnNo_of_Bene_Male" msprop:Generator_ColumnPropNameInTable="No_of_Bene_MaleColumn" minOccurs="0">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="30" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="No_of_Bene_Female" msdata:ReadOnly="true" msprop:Generator_UserColumnName="No_of_Bene_Female" msprop:Generator_ColumnPropNameInRow="No_of_Bene_Female" msprop:Generator_ColumnVarNameInTable="columnNo_of_Bene_Female" msprop:Generator_ColumnPropNameInTable="No_of_Bene_FemaleColumn" minOccurs="0">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="30" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="Daily_Cost_Per_Person" msdata:ReadOnly="true" msprop:Generator_UserColumnName="Daily_Cost_Per_Person" msprop:Generator_ColumnPropNameInRow="Daily_Cost_Per_Person" msprop:Generator_ColumnVarNameInTable="columnDaily_Cost_Per_Person" msprop:Generator_ColumnPropNameInTable="Daily_Cost_Per_PersonColumn" minOccurs="0">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="30" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="Acc_Exp" msdata:ReadOnly="true" msprop:Generator_UserColumnName="Acc_Exp" msprop:Generator_ColumnPropNameInRow="Acc_Exp" msprop:Generator_ColumnVarNameInTable="columnAcc_Exp" msprop:Generator_ColumnPropNameInTable="Acc_ExpColumn" minOccurs="0">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="30" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="Autokey1" msdata:ReadOnly="true" msdata:Caption="Autokey" msprop:Generator_UserColumnName="Autokey1" msprop:Generator_ColumnPropNameInRow="Autokey1" msprop:Generator_ColumnVarNameInTable="columnAutokey1" msprop:Generator_ColumnPropNameInTable="Autokey1Column" minOccurs="0">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="30" />
</xs:restriction>
</xs:simpleType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
</xs:element>
</xs:schema>
IIS slow on vista
http://forums.iis.net/t/1100987.aspx
conn str props: http://weblogs.asp.net/wallen/archive/2005/03/22/395496.aspx
add in conn str of web.config Min Pool Size=5
Formatting PDF from reportviewer (multiple page crossing problem)
use ratio calc
http://www.continuum2.com/js_ratio.php
In the Report Properties dialog if I set Page width to 8.27in and Page height to 11.69in then the Page Setup dialog of ReportViewer defaults to A4.
In the Report Properties dialog if I set Page width to 11.69in and Page height to 8.27in then the Page Setup dialog of ReportViewer defaults to A4, and Orientation defaults to Landscape.
--