|
Please help me with the following using the 5.0.2
1-How to write automatic page numbers in PDF files generated?
2-How to write footers?
Kindly point me to an example that really works. I have seen several that did not work.
Thanks
EK
|
|
|
|
|
What is the exact code to write a fixed width text file in C#?
example:
instead of this:
IPLPPHPGHPGYINFSYEVLTPLKWYQSMMRHEYPSYGYEPMGGWLHHQIIPVLSQQHSPSHSLPPQHHIPI
I want:
IPLPPHPGHPG
YINFSYEVLTP
LKWYQSMMRHE
YPSYGYEPMGG
WLHHQIIPVLS
QQHSPSHSLPP
QHHIPI
|
|
|
|
|
I gave you the algorithm.
Do not repost, its rude, and we will not do your homework assignments for you.
ragnaroknrol The Internet is For Porn[^]
Pete o'Hanlon: If it wasn't insulting tools, I'd say you were dumber than a bag of spanners.
|
|
|
|
|
It is not a job nor a homework assignment so relax tool
|
|
|
|
|
Iman Mohtashemi wrote: It is not a job nor a homework assignment so relax tool
Look, I can do this, in a far more efficent manner with shorter and clearer code you were given. I gave you the algorithm you needed, but it turns out you are either too stupid or too lazy to work out how to code it yourself.
Worse, when you weren't given the the code you wanted immediately you reposed with the standard "snd codez plz" response we get so much of here. It's not too much to posit you are in fact the tool in all this, at least I can code.
ragnaroknrol The Internet is For Porn[^]
Pete o'Hanlon: If it wasn't insulting tools, I'd say you were dumber than a bag of spanners.
|
|
|
|
|
Are you kidding me? It's not even hard.
|
|
|
|
|
that does not look like a fixed width at all, it is all jagged.
|
|
|
|
|
The exact code has some letters, punctuation and some numbers. There, all you need to do is rearrange them into the correct sequence.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Hello,
How do I write a fixed width text file (say 80 characters per line) using the streamwriter in C#?
shekee
|
|
|
|
|
Seeing as you asked a general question, here is a general answer:
Prepare the string for the current line. If it is too long, truncate and use the remainder for the next line. If it is too short, pad it with spaces. Repeat until you have written everything.
To write to a file you'll need System.IO , there is a TextWriter class in there that you can use.
ragnaroknrol The Internet is For Porn[^]
Pete o'Hanlon: If it wasn't insulting tools, I'd say you were dumber than a bag of spanners.
|
|
|
|
|
Sorry,
What is the exact code to write a fixed width text file in C#?
example:
instead of this:
IPLPPHPGHPGYINFSYEVLTPLKWYQSMMRHEYPSYGYEPMGGWLHHQIIPVLSQQHSPSHSLPPQHHIPI
I want:
IPLPPHPGHPG
YINFSYEVLTP
LKWYQSMMRHE
YPSYGYEPMGG
WLHHQIIPVLS
QQHSPSHSLPP
QHHIPI
|
|
|
|
|
I gave you a basic algorithm to do exactly what you want (and information about file IO) , I'm not going to write the code for you, that is your job / assignment.
No-one is going to give you the code here, please read the FAQs and Sickies at the top of the forum.
ragnaroknrol The Internet is For Porn[^]
Pete o'Hanlon: If it wasn't insulting tools, I'd say you were dumber than a bag of spanners.
|
|
|
|
|
Try this code ...
FileStream fs = new FileStream("<Full Path FileName>", FileMode.OpenOrCreate);
StreamWriter sw = new StreamWriter(fs);
string message = "<TextToWrite>";
int charcount = 0;
foreach(char ch in message)
{
sw.Write(ch);
charcount++;
if (charcount % 80 == 0)
sw.WriteLine();
}
sw.Close();
|
|
|
|
|
|
Hi
I am trying to show the data in pdf file using asp.net with C#. I pulled up the data in the datagrid first from the database. Now i wanted to show them in pdf file. Well the data is showing in pdf file in tabular form. But Can i show them without in tabular form rather it should be like just a note or letter format? If i can, can you give some idea how can I do that ?
suchita
|
|
|
|
|
You can access cell by cell of your dataGrid and use then
in whatever way you need.
Find sample code below for the same.
for(int i=0;i<<dataGridView1.Rows.Count;i++)
{
for(int j=0;j<<dataGridView1.Cells.Count;i++)
{
}
}
HTH
Jinal Desai - LIVE
Experience is mother of sage....
|
|
|
|
|
Hi,
I'm working on .Net Chart Control. X Axis scale label looks not nice. For example, it should be 0, 0.5, 1, 1.5, 2 etc.
My chart X Axis scale looks like this: 0, 3.51600003242493, 4.968998626709 6.3759999272075 9.18900012969971 etc.
Does anyone know how to set it nicer?
How could I post screen shot in here?
Thanks
|
|
|
|
|
Hi
I`m trying to automate navigation of a WebBrowser control by automatically filling in some fields and clicking a button to log a user in. I get it working by searching for the appropriate Input tags, and then setting their values. I submit the form by calling SendKeys("{Enter}") . However, I run into trouble sometimes using this SendKeys method, because this means that the WebBrowser control always needs to have focus. The reason why I didn't search for the Login button and calling its click event, is because I don't know how. The username and password fields both have unique name and id fields that identify them.
Below is a snippet of Facebook's login page. If anyone can go through this and tell me how I would call the click method on the login button, I would appreciate it. Or can I call a "form submit" method somehow? I've underlined what I think the Login button is:
<div class="menu_login_container"><form method="POST" action="https://login.facebook.com/login.php?login_attempt=1" id="login_form" onsubmit=";var d=document.documentElement;if (d.onsubmit) { return d.onsubmit(event); }else { return Event.fire(d, "submit", event); }"><input type="hidden" name="charset_test" value="€,´,€,´,水,Д,Є" /><input type="hidden" id="locale" name="locale" value="en_US" autocomplete="off" /><table cellspacing="0"><tr><td class="html7magic"><label for="email">Email</label></td><td class="html7magic"><label for="pass">Password</label></td></tr><tr><td><input type="text" class="inputtext" name="email" id="email" value="" tabindex="1"></input></td><td><input type="password" class="inputtext" name="pass" id="pass" tabindex="2"></input></td><td><label class="uiButton uiButtonConfirm uiButtonMedium"><input value="Login" tabindex="4" type="submit"></input></label></td></tr><tr><td class="login_form_label_field"><input type="checkbox" class="inputcheckbox" value="1" id="persistent" name="persistent" tabindex="3"></input><label id="label_persistent" for="persistent">Keep me logged in</label></td><td class="login_form_label_field"><a href="http://www.facebook.com/reset.php" rel="nofollow">Forgot your password?</a></td></tr></table><input type="hidden" name="charset_test" value="€,´,€,´,水,Д,Є" /><input type="hidden" id="lsd" name="lsd" value="iV6iE" autocomplete="off" /></form><br />
</div></ul></div></div>
And then also, if I may ask, is there any way I can programatically log a user out of Facebook? Maybe using a custom URL?
|
|
|
|
|
I just figured it out Below is what I used:
if (element.GetAttribute("value") == "Login")
{
element.InvokeMember("click");
}
|
|
|
|
|
I am having some difficulty with a DataGrid object in my Forms application and could greatly use some advice/assistance.
My DataGrid is receiving constant updates from a server application with changing data. This is reflected by changing the DataTable object that is set as it's DataGrid.DataSource. The problem is, however, that these refreshes seem to steal Focus from other Controls (TextBox, ComboBox) that are needed. At the moment, I have to repeatedly keep trying to hit a button and hope that I can finally land a OnButtonClicked event between refreshes for it to finally register.
Now I have another application that is doing a very similar thing, but it does not have this problem. At first I noticed that the other application doesn't have the other buttons on the same Panel, but after trying to put my DataGrid inside it's own Panel, it's own TabPage, and even grouping my Buttons within a GroupBox, the Buttons and TextBox can't seem to keep focus for long enough to do anything. I've set my DataGrid to "TabStop = false" and even "CausesValidation = false", but these also did not help.
The DataGrid became my all-seeing all-knowing master of Focus, and I am now it's slave.
Here's a visual to help understand the layout and visualize the problem:
Take a look![^]
If anybody has any advice or help, it would be greatly appreciated!
|
|
|
|
|
Just try one trick.
Before loading data to datagrid disable it and, once
data is loaded make it enable.
dataGridView1.Enable=false;
dataGridView1.Datasource=dataTable1;
dataGridView1.Enable=true;
HTH
Jinal Desai - LIVE
Experience is mother of sage....
|
|
|
|
|
Well, I finally discovered the problem. It was a side affect of the DataGrid being updated, and not the update itself. On an update, any changed data is sent to the TextBox and that part of the system was unaware to me. They were losing their focus because all objects were trying to refresh their data and not just the DataGrid.
Also, the update to the DataGrid was being done through a DataTable, in which I never did need to refresh the DataSource variable. You simply have to:
DataRow row = _pumpTable.Rows[index];
row.BeginEdit();
row.EndEdit();
row.AcceptChanges();
Thank you for your reply!
|
|
|
|
|
I am having a problem and been looking for days on passing a variable to a textbox in reportviewer.
Currently I have one date string and eventually will have six that I want to pass to textboxes in my .rdlc report. I am pulling information from a database to place in the report and have constructed a dataset. The dataset does not allow me to pull the dates I need since they are future dates, i.e. timecards/dairycards and the dates are picked from a calendar control, The dates are stored as variables and placed in an array for the report.
I keep getting the following error message when I run the report:
LocalProcessingException was unhandled.
Microsoft.Reporting.WinForms.LocalProcessingException was unhandled
Message="An error occurred during local report processing."
Source="Microsoft.ReportViewer.WinForms"
Below is my code for the btnRun_Click event:
private void btnRun_Click(object sender, EventArgs e)
{
reportViewer1.ProcessingMode = ProcessingMode.Local;
LocalReport localReport = reportViewer1.LocalReport;
reportViewer1.LocalReport.ReportPath = "Report1.rdlc";
string param0 = GlobalClass.GlobalVar;
ReportParameter inputdata = new ReportParameter("DateOne", param0);
<code>this.reportViewer1.LocalReport.SetParameters(new ReportParameter[] {inputdata});</code>
this.EMPLOYEESTableAdapter.Fill(this.AttendanceDataSet.EMPLOYEES);
this.reportViewer1.RefreshReport();
}
I have highlighted the line of code that the exception is thrown at.
I do have on my report the textbox expression set as:
=Parameters!inputdata.Value
I have looked everywhere I can think to find a solution. Any advice would be helpful.
Thanks in advance
|
|
|
|
|
Hello,
I am using Dynamic dictionary in C#. The problem which I am facing , is the usage of TryGetMember behavior which i am overriding in dynamic dictionary class.
here's the code of dynamic dictionary.
class DynamicDictionary : DynamicObject
{
private IDictionary m_dictionary;
public DynamicDictionary(IDictionary<string, TValue> a_dictionary)
{
m_dictionary = a_dictionary;
}
public override bool TryGetMember(GetMemberBinder a_binder, out object a_result)
{
bool returnValue = false;
var key = a_binder.Name;
if (m_dictionary.ContainsKey(key))
{
a_result = m_dictionary[key];
returnValue = true;
}
else
a_result = null;
return returnValue;
}
}
Here TryGetMember will be called at runtime whenever we refer some key from outside. But strange here that binder's Name member which always give the key what we refer from outside. Strange here that it always resolve the key name what written as characters of alphabets.
e.g if make the object of DynamicDictionary as
Dictionary<string,List<String>> dictionaryOfStringVsListOfStrings;
dictionaryOfStringVsListOfStrings.Add("Test", listOfStrings); //here listOfStrings some strings list already populated with strings
dynamic dynamicDictionary_01 = new DynamicDictionary(dictionaryOfStringVsListOfStrings);
string somekey = "Test";
List listOfStringsAsValue = dynamicDictionary_01.somekey //will be resolve at runtime
Now here what happens actually "somekey" will become the value of a_binder (i.e a_binder.Name="somekey") what I need that key assigned value should be resolved as key. i.e it should be resolved as a_binder.Name = "Test" and then from dynamic dictionary it will locate listOfStrings against this key i.e actually "Test" but it resolves not the value but actual variable name as key..
Way around?
Regards Usman
|
|
|
|
|
I just want to make my form, free of its Parent and change WindowState and BorderStyle of it for a fullscreen view.
Anybody have some suggestions?
Bye bye
|
|
|
|