|
Hello ,I want to generate crystal report to generate invoice using two tables CustomerOrder and OrderDetails..please help on how to handle multiple tables in crystal report
|
|
|
|
|
you could use a stored procedure that joins multiple tables
|
|
|
|
|
I am fairly new to programming and am maintaining a legacy web application.
Need to access a checkbox value and send it via email built in the same aspx page using C# code.
Here is the code. Any help on this will be much appreciated.
<pre lang="c#">
emailBody +="<tr>";
emailBody +="<td align='right' width='10%'><FONT face='Verdana' size='1'> Do you have any active MTY billing?: </FONT></td>";
emailBody +="<td width='20%'><FONT face='Verdana' size='2'> " + chkValue + "</FONT></td>";
emailBody +="</tr>";
<td colspan="4">
<input type="checkbox" name="Yes" id="chkYes" value="" onclick="alert('Do something');"/><B><FONT size="1" face="Verdana"> Yes </FONT></B>
<input type="checkbox" name="No" id="chkNo" value=""/> <B><FONT size="1" face="Verdana"> No</FONT></B>
</td>
|
|
|
|
|
I think you should be using radio buttons instead of check boxes because checkbox is for multiple options. Anyways since you are using html controls in page I suggest you use jQuery code to update a hidden field value and read the same from C# code.
In your html code near checkboxes/radiobuttons add this
now in your javascript write the following code function which is called on checkbox checked event.
JavaScript/jQuery
==============================================================
function CaptureAndUpdate(val)
{
if(val.checked==true)
$('.hdn_checkBoxResult').val(true);
else
$('.hdn_checkBoxResult').val(false);
}
your html checkbox becomes
==========================================================
Rajesh K
|
|
|
|
|
Thanks for the response..
I also have few other hidden inputs in the same page and they work fine.
As per your suggestion:
1) Added radio buttons instead of checkboxes.
2) Added hidden input field hdn_checkBoxResult.
3) Called a function to check if the value of radio button is true, if so, then assign value to hdn_checkBoxResult.
4) Appended hdn_checkBoxResult.Value in the email.
Is there anything else I am missing?
The email still doesn't show the selected radio button value.
Here is my code:
..............................................................................................
<td colspan="4">
<input type="radio" name="rdoCheck" id="rdoYes" value="" onclick ="theChecker(val)" />
<b><font size="1" face="Verdana">Yes </font></b>
<input type="radio" name="rdoCheck" id="rdoNo" value="" />
<b><font size="1" face="Verdana">No</font></b>
</td>
Have declared this hidden input field outside the table.
<input type="hidden" runat="server" id="hdn_checkBoxResult" name="hdn_checkBoxResult" />
function theChecker(val)
{
if(val.Checked ==true)
{
$('.hdn_checkBoxResult').val(true);
alert('alert msg');
}
else
{
$('.hdn_checkBoxResult').val(false);
}
}
emailBody +="<tr>";
emailBody +="<td align='right' width='10%'><B><FONT face='Verdana' size='1'>Question ? </FONT></B></td>";
emailBody +="<td width='20%'><FONT face='Verdana' size='2'> " + hdn_checkBoxResult.Value + "</FONT></td>";
emailBody +="</tr>";
modified 18-Jun-15 15:29pm.
|
|
|
|
|
Are you using asp.net control for submitting the form ?
If yes then use asp.net radio buttons for capturing values of 'Yes' or 'No'
as follows replace the html controls with asp.net controls.
If no then use asynchronous call to call the WebMethod in page and send values as bool or string.
|
|
|
|
|
Thanks RajeshKasani it works now.
|
|
|
|
|
I have some strings to represent the names of forms and controls.
for example;
MenuLogin = name of an instance of System.Windows.Forms.MenuItem
Now I want to assign Text value to the object whose name is the string at run time.
I.e:
s1 = "MenuExit"
Object(s1).Text = Exit login window //find an object,Name:MenuExit
I can't find a method in the Object that can search an object with name "MenuExit" in the application.
Please tell me how to implement it, thanks.
modified 17-Jun-15 15:29pm.
|
|
|
|
|
Are you wanting to know how to do this in C#?
|
|
|
|
|
Sure, Thanks.
I rewrote my question. In fact, I don't want to create a new object,
I just want to find the object with the name: xx-YY.
|
|
|
|
|
I try to use Assembly.GetExecutingAssembly().
Thanks
|
|
|
|
|
I think you misunderstood Pete's comment, this is a C# forum, and your question is Visual Basic. There is a designated forum for VB questions.
As for your question; I'm not entirely sure what you want, WinForms are not my expertise. It seems like the .Text method does not exists in s1.
|
|
|
|
|
econy wrote: I can't find a method in the Object You annot assume that Object will contain such a method; and where would it search for these items? You would need to first create some type of List that contains all the Objects, which you then search by name.
|
|
|
|
|
Hello,
i want use an external Method there will be get an Struct.
The Struct is lokk like this:
typedef struct _SYSTEM_POWER_STATUS {
BYTE ACLineStatus;
BYTE BatteryFlag;
BYTE BatteryLifePercent;
BYTE Reserved1;
DWORD BatteryLifeTime;
DWORD BatteryFullLifeTime;
} SYSTEM_POWER_STATUS, *LPSYSTEM_POWER_STATUS;
In C# it looks like this:
struct SystemPowerStatus
{
byte ACLineStatus;
byte batteryFlag;
byte batteryLifePercent;
byte reserved1;
int batteryLifeTime;
int batteryFullLifeTime;
}
So, i want to rename the Fields. How i can do it? must the Structs Fields named like the original Struct?
Best regard
Armin
|
|
|
|
|
The field names don't matter. So if you're writing a struct, you can choose any names you like. A smart developer would have simply tried it; you learn more that way.
|
|
|
|
|
Piebald is right - the names are irrelevant.
If you want to "match" the two structures though, then that's probably because you are planning on sending or receiving them from / to an external unmanaged application of DLL. If so, you have to ensure they are identical in layout: so add a StructLayout Attribute[^] to your C# version to force the compiler not to optimise the memory.
In this particular case, it's probably irrelevant (as there are four bytes before the first 32bit number) but that isn't always the case.
It's worth checking if this site has a structure that is compatible ready for use: http://pinvoke.net/default.aspx/Structures/SYSTEM_POWER_STATUS.html[^]
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
If you're using Windows Forms, you don't need this structure, or the P/Invoke method; the SystemInformation.PowerStatus property[^] will give you the same information.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Hello,
it was an sample.
Thanks.
|
|
|
|
|
How many forms include in Emplyee's attendace system?
|
|
|
|
|
Depends how many you want, and what you want to record and show in your system.
|
|
|
|
|
This will depend on the number of features you want to provide in your attendance system.
It will also depend on your UI design - you could show everything in one form or have different forms for each piece of functionality.
|
|
|
|
|
hi
How to print a page of stickers in C# WinForm
i try with crystal-report without success.
thanks
|
|
|
|
|
The simplest way is to use a PrintDocument[^] - create a method to print a label, and call it repeatedly.
The class gives you complete control over the printing on your page, and exactly where everything goes.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
|
|
|
|
|
hi
i have dataGridView that show my table.
how to update dataGridView cell by fill it ?
for example i have table MEN that contain field Age
when i stand on my age cell on dataGridView and change the value - i need that it will
change in the database too.
how to do it ?
work on C# Winform
|
|
|
|
|