
Developer to create Application 'Print' facility
5242
$$
- Posted:
- Proposals: 2
- Remote
- #119596
- Archived
Description
Experience Level: Intermediate
We have built an application that serves as a survey. It has 3 sections, the first 2 will give us information which we will collate, and the client will use to analyse. The third section will provide information in a report format. For meeting purposes the client has asked us to add a 'print' feature on the application to facilitate the report as a hard copy.
Could you please quote to provide a 'print' option on an intranet, which will also be portable and go on a CD to third party users?
The spec for the print work to find a quote is....
We have Silverlight 4 C# code that reads an XML file and produces a print format of header, subheader and three column datagrid. Sample code is below for the "A" section of data.
We need code delivered that builds on this code to enhance it so that
(1) it is able to run the print of the grid on to subsequent pages if the content of the cells is so lengthy, and does not break a cell's data across two pages;
(2) The central column, called Level in the code below, needs changing from an image format to text with a coloured background. The colour of the background will be one of Red, Amber, Green or Gold;
(3) Without the user having to specify something or rerun the report, the code needs to handle the "B" and "C" data in two further, similarly formatted report print-outs. These "B" and "C" data sets are the same format and in the same XML file as the "A" data set and will each have a header and sub-header of their own. You can see the parameter of the data set attribute in the line
...where info.Attribute("Area").Value == "A"
public void Print()
{
var doc = new PrintDocument();
doc.PrintPage += (object sender, PrintPageEventArgs e) =>
{
var canvas = new Canvas();
canvas.Height = 1123.2;
canvas.Width = 797.8;
//Header
TextBlock headerArea = new TextBlock();
headerArea.TextWrapping = TextWrapping.Wrap;
headerArea.Width = canvas.Width - (96 * 2);
headerArea.Height = 20;
headerArea.HorizontalAlignment = System.Windows.HorizontalAlignment.Center;
Run run1 = new Run();
run1.Text = "Title of Report";
run1.FontWeight = FontWeights.Bold;
run1.FontSize = 13;
headerArea.Inlines.Add(run1);
TextBlock subheader = new TextBlock();
subheader.TextWrapping = TextWrapping.Wrap;
subheader.Width = canvas.Width - (96 * 2);
subheader.Height = 20;
subheader.HorizontalAlignment = System.Windows.HorizontalAlignment.Left;
Run run2 = new Run();
run2.Text = "Subtitle";
run2.FontWeight = FontWeights.Bold;
run2.FontSize = 11;
subheader.Inlines.Add(run2);
//Grid
DataGrid dg = new DataGrid();
string isostorefilename = App.SessionText;
using (IsolatedStorageFile isoStore = IsolatedStorageFile.GetUserStoreForApplication())
{
using (var isoStream = new IsolatedStorageFileStream(isostorefilename, FileMode.Open, isoStore))
{
XDocument oDoc = XDocument.Load(isoStream);
var myData = from info in oDoc.Element("topleveltag").Elements("nextleveltag").Descendants("thirdleveltag")
where info.Attribute("Area").Value == "A"
select new DisplayComponent
{
Description = Convert.ToString(info.Attribute("Name").Value),
Level = new BitmapImage(new Uri(GetURL(Convert.ToString(info.Attribute("Level").Value)), UriKind.RelativeOrAbsolute)),
Indicators = Convert.ToString(info.Value).Trim(),
};
dg.ItemsSource = myData;
}
}
dg.Width = canvas.Width - (96 * 2);
canvas.Children.Add(headerArea);
canvas.Children.Add(subheader);
canvas.Children.Add(dg);
Canvas.SetTop(headerArea, 96);
Canvas.SetLeft(headerArea, 96);
Canvas.SetTop(subheader, 116);
Canvas.SetLeft(subheader, 96);
Canvas.SetTop(dg, 146);
Canvas.SetLeft(dg, 96);
e.PageVisual = canvas;
e.HasMorePages = false;
};
doc.Print("AReportName");
}
The XML file looks like this:
Idgfghh rtyry
There is no resource or documentation related to this component of the system.
Trust it makes sense to techies out there.
Could you please quote to provide a 'print' option on an intranet, which will also be portable and go on a CD to third party users?
The spec for the print work to find a quote is....
We have Silverlight 4 C# code that reads an XML file and produces a print format of header, subheader and three column datagrid. Sample code is below for the "A" section of data.
We need code delivered that builds on this code to enhance it so that
(1) it is able to run the print of the grid on to subsequent pages if the content of the cells is so lengthy, and does not break a cell's data across two pages;
(2) The central column, called Level in the code below, needs changing from an image format to text with a coloured background. The colour of the background will be one of Red, Amber, Green or Gold;
(3) Without the user having to specify something or rerun the report, the code needs to handle the "B" and "C" data in two further, similarly formatted report print-outs. These "B" and "C" data sets are the same format and in the same XML file as the "A" data set and will each have a header and sub-header of their own. You can see the parameter of the data set attribute in the line
...where info.Attribute("Area").Value == "A"
public void Print()
{
var doc = new PrintDocument();
doc.PrintPage += (object sender, PrintPageEventArgs e) =>
{
var canvas = new Canvas();
canvas.Height = 1123.2;
canvas.Width = 797.8;
//Header
TextBlock headerArea = new TextBlock();
headerArea.TextWrapping = TextWrapping.Wrap;
headerArea.Width = canvas.Width - (96 * 2);
headerArea.Height = 20;
headerArea.HorizontalAlignment = System.Windows.HorizontalAlignment.Center;
Run run1 = new Run();
run1.Text = "Title of Report";
run1.FontWeight = FontWeights.Bold;
run1.FontSize = 13;
headerArea.Inlines.Add(run1);
TextBlock subheader = new TextBlock();
subheader.TextWrapping = TextWrapping.Wrap;
subheader.Width = canvas.Width - (96 * 2);
subheader.Height = 20;
subheader.HorizontalAlignment = System.Windows.HorizontalAlignment.Left;
Run run2 = new Run();
run2.Text = "Subtitle";
run2.FontWeight = FontWeights.Bold;
run2.FontSize = 11;
subheader.Inlines.Add(run2);
//Grid
DataGrid dg = new DataGrid();
string isostorefilename = App.SessionText;
using (IsolatedStorageFile isoStore = IsolatedStorageFile.GetUserStoreForApplication())
{
using (var isoStream = new IsolatedStorageFileStream(isostorefilename, FileMode.Open, isoStore))
{
XDocument oDoc = XDocument.Load(isoStream);
var myData = from info in oDoc.Element("topleveltag").Elements("nextleveltag").Descendants("thirdleveltag")
where info.Attribute("Area").Value == "A"
select new DisplayComponent
{
Description = Convert.ToString(info.Attribute("Name").Value),
Level = new BitmapImage(new Uri(GetURL(Convert.ToString(info.Attribute("Level").Value)), UriKind.RelativeOrAbsolute)),
Indicators = Convert.ToString(info.Value).Trim(),
};
dg.ItemsSource = myData;
}
}
dg.Width = canvas.Width - (96 * 2);
canvas.Children.Add(headerArea);
canvas.Children.Add(subheader);
canvas.Children.Add(dg);
Canvas.SetTop(headerArea, 96);
Canvas.SetLeft(headerArea, 96);
Canvas.SetTop(subheader, 116);
Canvas.SetLeft(subheader, 96);
Canvas.SetTop(dg, 146);
Canvas.SetLeft(dg, 96);
e.PageVisual = canvas;
e.HasMorePages = false;
};
doc.Print("AReportName");
}
The XML file looks like this:
Idgfghh rtyry
There is no resource or documentation related to this component of the system.
Trust it makes sense to techies out there.
Tania T.
100% (3)Projects Completed
7
Freelancers worked with
6
Projects awarded
18%
Last project
30 Sep 2014
United Kingdom
New Proposal
Login to your account and send a proposal now to get this project.
Log inClarification Board Ask a Question
-
There are no clarification messages.
We collect cookies to enable the proper functioning and security of our website, and to enhance your experience. By clicking on 'Accept All Cookies', you consent to the use of these cookies. You can change your 'Cookies Settings' at any time. For more information, please read ourCookie Policy
Cookie Settings
Accept All Cookies