|
Pleased to help.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
I would not create a new image, instead resize the control to match the image size, and locate it appropriately.
And of course, if I were to paint the image myself, there would be no PictureBox at all.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
Hi all,
I have an issue with the report viewer. I created my reports with reportviewer tool and everything
works ok.
My problem is, once I created a report and close the report form and then I tried to update
something on my database I always received and error message that the database cannot been opened.
So my question here is ... How can I force reportviewer to close any database opened after I close
my report form?
Here is the complete code of my report form:
<pre>
using System;
using System.Windows.Forms;
namespace SACK
{
public partial class frmReportes : Form
{
public frmReportes()
{
InitializeComponent();
}
private void frmReportes_Load(object sender, EventArgs e)
{
this.repViewer.RefreshReport();
}
private void btnSalir_Click(object sender, EventArgs e)
{
this.Close();
}
private void btbGenerarReporte_Click(object sender, EventArgs e)
{
DateTime fechaIni = Convert.ToDateTime(dtpFechaIni.Text);
DateTime fechaFin = Convert.ToDateTime(dtpFechaFinal.Text);
// Reporte de Entradas
if (rbuEntradas.Checked)
{
try
{
this.tPrinterTableAdapter.FillByEntradas(this.KardexPrinterDBDataSet.tProductos, fechaIni, fechaFin);
this.repViewer.LocalReport.ReportEmbeddedResource = "SACK.ReportByEntradas.rdlc";
this.repViewer.RefreshReport();
}
catch (System.Exception ex)
{
System.Windows.Forms.MessageBox.Show(ex.Message);
}
}
// Reporte de Salidas
if (rbuSalidas.Checked)
{
try
{
this.tPrinterTableAdapter.FillBySalidas(this.KardexPrinterDBDataSet.tProductos, fechaIni, fechaFin);
this.repViewer.RefreshReport();
}
catch (System.Exception ex)
{
System.Windows.Forms.MessageBox.Show(ex.Message);
}
}
// Reporte de Entradas / Salidas
if (rbuSalidas.Checked)
{
try
{
this.tPrinterTableAdapter.FillByEntradasSalidas(this.KardexPrinterDBDataSet.tProductos, fechaIni, fechaFin);
this.repViewer.RefreshReport();
}
catch (System.Exception ex)
{
System.Windows.Forms.MessageBox.Show(ex.Message);
}
}
// Reporte de Existencias
if (rbuSalidas.Checked)
{
try
{
this.tPrinterTableAdapter.FillByExistencias(this.KardexPrinterDBDataSet.tProductos, fechaIni, fechaFin);
this.repViewer.RefreshReport();
}
catch (System.Exception ex)
{
System.Windows.Forms.MessageBox.Show(ex.Message);
}
}
}
}
}
</pre>
Hope someone can help me on this... thank you!:cool
modified on Tuesday, August 11, 2009 2:56 PM
|
|
|
|
|
Hey,
This is a question I've had for a while and we just worked around it, but our libraries have grown substantially and it is becoming a bit of a pain to deal with. Perhaps one of you can enlighten me.
Say I create a class library called LibraryA. LibraryA has a dependency on another project called LibraryB (it has a reference to this other project).
When LibraryA is built, it properly adds LibraryB to its output folder. However, if I now actually use LibraryA in an application (by adding a reference to it), LibraryB doesn't get included and everything goes up in flames, nobody spared. I am forced to add a reference to LibraryA and LibraryB for it to work properly.
If you add a reference to one of the standard .NET libraries, it automatically adds a reference to all its dependencies. Is there a way to reproduce this behaviour with our own libraries?
|
|
|
|
|
Mike Marynowski wrote: If you add a reference to one of the standard .NET libraries, it automatically adds a reference to all its dependencies. Is there a way to reproduce this behaviour with our own libraries?
It's not quite the same effect, but marking your assemblies as CLS-compliant will require you to include all of the necessary references in each project. It may introduce other issues that need to be resolved in your code, but in general CLS-compliance is a good thing, especially for libraries that will be consumed by multiple projects.
Short of that, there is no way to automatically inlcude the references of referenced projects. The best option would be to introduce a post-build event that copies the necessary files or simply include the correct projects as references (even if they aren't used), which can be done whether the assemblies are CLS-compliant or not.
Scott Dorman Microsoft® MVP - Visual C# | MCPD
President - Tampa Bay IASA
[ Blog][ Articles][ Forum Guidelines] Hey, hey, hey. Don't be mean. We don't have to be mean because, remember, no matter where you go, there you are. - Buckaroo Banzai
|
|
|
|
|
Scott Dorman wrote: Short of that, there is no way to automatically inlcude the references of referenced projects
Are you saying that you know for a fact that there is no way, or just that there is no way that you are aware of?
I would be very surprised if there actually was NO WAY of doing it. I doubt the behaviour of the standard .NET libraries is somehow hard-coded into Visual Studio - there has to be a metadata file or something else that causes dependency libraries to be added when the dependent library is referenced.
Is this perhaps standard behaviour for libraries registered in the GAC? I haven't tried adding my libraries to the GAC and then referncing it.
|
|
|
|
|
Correct, there is no way to do this. What behavior are you referring to in Visual Studio? If I add a reference to System.Data without already having a reference to System, it doesn't add both references, only the one I specifically told it to add.
Registering the library in the GAC would have no affect on this behavior whatsoever.
Scott Dorman Microsoft® MVP - Visual C# | MCPD
President - Tampa Bay IASA
[ Blog][ Articles][ Forum Guidelines] Hey, hey, hey. Don't be mean. We don't have to be mean because, remember, no matter where you go, there you are. - Buckaroo Banzai
|
|
|
|
|
Madness I say!
I could swear I've added a reference to a system assembly before and it added more than one reference...but perhaps I'm just delusional.
If I don't reply again, it means I couldn't figure out where I saw that happen...if I figure it out, I'll reply again, lol.
|
|
|
|
|
foreach (DataGridViewRow dr in dgproducts.Rows)
{
if (Convert.ToInt32(dr.Cells[9].Value) < Convert.ToInt32(dr.Cells[6].Value))
{
## //i need to color this row here
}
}
## i need to colour the particular row at that point of the loop
i cant find anything like in that intellisense and sub-intellisense
maybe am not checking well.
any help plz
|
|
|
|
|
DataGridView.Rows.DefaultCellStyle.BackColor will do that.
It's not necessary to be so stupid, either, but people manage it. - Christian Graus, 2009 AD
|
|
|
|
|
Thanks am trying it out..
thanks a mill
|
|
|
|
|
I need to print the content of a data grid view.
Now i am using the DGV Printer: DGV Printer Class[^]
But i neet to print only some columns of the data grid view, columns specified by the user.
The DGV Printer prints all the content (all columns), so i can't specify which column must be print. How can i solve this problem ?
|
|
|
|
|
Well if simply you want to print some information and to neglect other, the first solution that hits the mind is to process all records and filter out specific columns. Then print that shortened version of information.
|
|
|
|
|
I don't know squat about the printer tool but have you tried setting the unwanted columns visible property befor printing.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
It don't work, i have just tried.
|
|
|
|
|
Hi there,
I am relatively new to .Net programming. I've been using the DataGrid to display my Datatables and i really like the way you can easily navigate to child rows in child tables that you've set up in the DataRelations.
But the more I used it the more i found out about its drawbacks and came across the DataGridView. This has been introduced since VS2005 and the .Net 2.0 framework. Now it has many appealing new functions which are very useful to me. But so far i have not been able to find a way to navigate as easily as with the DataGrid.
From examples i have found, to relate the DataGridView to a source you have to use the DataBindings class. This all seems like alot more effort than with the DataGrid where you would just set the .DataSource property.
So my question is, "Is there an equivalent to the .NavigateTo() and .NavigateBack() functions of the DataGrid in the DataGridView? If there isn't, has a common practice of achieving similiar results been found?"
I hope to hear from someone soon,
codeboy1988
|
|
|
|
|
Hi,
I have write an AddInCustomAction that must be performed before the Installation.
I did something like:
public override void Install(IDictionary stateSaver)
{
base.Install(stateSaver);
}
This doesn't work properly.
the file MyFile.txt exists (and so should be removed)
but after installation it still exists!!
Any Idea?
Thanks
|
|
|
|
|
You should show your real code - posting pseudocode won't help us solve the issue.
"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
|
|
|
|
|
Sorry, Here is the code:
public override Install(IDictionary stateSaver)
{
String path = this.Context.Parameters["targ"].ToString();
DirectoryInfo dir = new DirectoryInfo(path);
foreach (FileInfo f in dir.GetFiles())
{
if (f.Name == "MyFile.txt")
File.Delete(f.FullName);
}
base.Install(stateSaver);
}
|
|
|
|
|
hello...
i am working in a web application .i need to convert the time like... 5.00PM To 1700
6.10PM To 1810
12.00PM TO 2400 etc...
if there is any funtion that convert aal the time to thi format..and if not then tell me how could I do this...
Thanks in Advance
|
|
|
|
|
Something like this:
public static string ConvertTimeString(string time)
{
return DateTime.ParseExact(
time,
"h.mmtt",
CultureInfo.InvariantCulture).ToString("HHmm");
}
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
merahul wrote: 12.00PM TO 2400
What? That's not right.
Are you talking about user input? Why not have the user enter the data in the format you require?
|
|
|
|
|
merahul wrote: 12.00PM TO 2400
12PM is 12:00
12AM is 00:00
there is no 24:00 in 24h time
|
|
|
|
|
J4amieC wrote: there is no 24:00 in 24h time
that is debatable[^].
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
They can debate all they want, but 24:00 makes no sense.
|
|
|
|