|
why can't you use PrintDocument?
it's as simple as this[^]
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
thanks...it's perfect. But the quality of the print it's low quality.
|
|
|
|
|
Hi everybody
I want to know what does this code do, why do they put a delegate? please explain me the topics and concepts behind every word
Thanks
Converter<int, String> converter = new Converter<int, String>(delegate(int value){return Convert.ToString(value);});
|
|
|
|
|
Angel Romero wrote: please explain me the topics and concepts behind every word
Why? They are already explained on the MSDN Web site. If I type it into a forum message you still have to READ IT. What's the point?
|
|
|
|
|
Well it doesn't explain why they use "delegate" or Generics for this conversion
|
|
|
|
|
Angel Romero wrote: Well it doesn't explain why they
And how would anyone but "them" know why "they" did it?
You might want to check this out[^]
|
|
|
|
|
Well thanks for your answers
I can't find what I need from you
Thanks anyway
|
|
|
|
|
Angel Romero wrote: Well thanks for your answers
And thank you for answering my question.
Good luck, you're going to need it.
|
|
|
|
|
It fits in their design pattern? It was required by some part of the .NET library? Who knows? Up to them, right? Whoever they might be..
|
|
|
|
|
the difference is that is you do the running around then the OP only needs look at 1 page lol
So... Go Fetch!
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
Explaining this seems a bit pointless, as if you cannot understand the general purpose of the delegate keyword in this context then you need to read up on the C# language.
Saying that working backwards:
delegate(int value){return Convert.ToString(value);}
This line is an inline way of writing:
public static string MyConvertMethod(int value)
{
return Convert.ToString(value);
}
new Converter<int, String>(...)
This instantiates a Generic class (or delegate) named Converter with the item in parenthesis being the delegate itself.
Converter<int, String> converter = ...
The instantiated class (or delegate) is assigned to a variable named 'converter'.
I hope ive explained every word for you!
|
|
|
|
|
J4amieC wrote: read
What is the meaning of this word?
only two letters away from being an asset
|
|
|
|
|
Taken out of context, it could be the present or past tense of the verb "to read". It could be an item made of wood that is placed in the mouthpiece of a wind instrument, a mis-spelling of a common plant found beside a lake or finally an acronym for "Relative Element Address Designate" from the field of cryptography.
Take your pick and run with it.
|
|
|
|
|
J4amieC wrote: It could be an item made of wood that is placed in the mouthpiece of a wind instrument
I belive that is spelled "reed"...
|
|
|
|
|
He must yoose a splell chekker!
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Goood
Thanks!!
I really appreciate your help!
|
|
|
|
|
The Thread object getting with Thread ID <---- is possible?
There will be what kind of method and peels?
exam 1)
System.Diagnostics.ProcessThreadCollection ptc = curProc.Threads;
foreach (System.Diagnostics.ProcessThread ptt in curProc.Threads)
{
System.Threading.Thread th = ptt.id <--------- casting failed : ID is int type
Or
System.Threading.Thread th = (System.Threading.Thread)ptt.id <-------- casting failed
}
exam 2)
System.Diagnostics.ProcessThreadCollection ptc = curProc.Threads;
System.Diagnostics.StackTrace[] st = new System.Diagnostics.StackTrace[ptc.Count];
foreach (System.Diagnostics.ProcessThread ptt in curProc.Threads)
{
st[iPtCnt] = new System.Diagnostics.StackTrace(ptt, true); <--- casting failed ptt
}
MSDN) OverLoad List ---> StackTrace(Thread, Boolean)
.
|
|
|
|
|
Hi,
AFAIK you can't get a Thread unless you are creating one, as in Thread thr=new Thread(...);
The ManagedThreadId is a number that helps you in differentiating threads, I use it when logging application progress and intermediate results.
Luc Pattyn [Forum Guidelines] [My Articles]
DISCLAIMER: this message may have been modified by others; it may no longer reflect what I intended, and may contain bad advice; use at your own risk and with extreme care.
|
|
|
|
|
Didn't you ask a verbatim question here[^] and get the same answer?
|
|
|
|
|
i user this code to get all users on the domain but it only returns me 1,000 users the problem is i have over 3,000 users in my domain what can i do to get the entire user list from AD
public static ArrayList GetAllADDomainUsers()
{
string domainpath = @"LDAP://DC=tshospital,DC=com";
ArrayList allUsers = new ArrayList();
DirectoryEntry searchRoot = new DirectoryEntry(domainpath);
DirectorySearcher search = new DirectorySearcher(searchRoot);
search.Filter = "(&(objectClass=user)(objectCategory=person))";
search.PropertiesToLoad.Add("samaccountname");
SearchResult result;
SearchResultCollection resultCol = search.FindAll();
if (resultCol != null)
{
for (int counter = 0; counter < resultCol.Count; counter++)
{
result = resultCol[counter];
if (result.Properties.Contains("samaccountname"))
{
allUsers.Add((String)result.Properties["samaccountname"][0]);
//allUsers.Add(result.GetDirectoryEntry());
}
}
}
return allUsers;
}
|
|
|
|
|
You have to perform a paged seach, you can't exceed the server side limit of
1000 objects returned.
See DirectorySearcher.PageSize [^]property.
Manas Bhardwaj
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
PLEASE HELP ME TO GENERATE DYNAMIC CRYSTAL REPORTS BY SETTING DATE AS PARAMETER FIELD.
RAJESH
|
|
|
|
|
Umm, take it easy with the capitals.
What's the problem?
|
|
|
|
|
dont try any more. i had your question for a long time.
it has no answer.i searched a lot on the web.but you search again for it. you may find it. i made a
code to serialize it into xml and create a dynamic report.
i have this code for microsoft reports(.RDLC) it is not CrystalReport but it may solve your problem. it is incomplete. and also has errors. its incomplete because i tried to print my views directly.
if you fixed it send it to me.
namespace Proj.RDLC_Reports
{
enum Alignment
{
Right,
Left,
Center
}
interface IXMLExportable
{
string ToXml();
bool IsAvailable { get; }
}
static class Class_RDLCReportCreator
{
static Report CreateReportByGrid(System.Windows.Forms.DataGridView DataGridView, System.Drawing.Printing.PaperKind PaperKind, bool Portrait, DataSources DataSources, Proj.RDLC_Reports.ReportParameters ReportParameters)
{
Report R = new Report();
R.DataSources = DataSources;
R.Language = "en-US";
R.ReportParameters = ReportParameters;
Table T = new Table();
foreach (System.Windows.Forms.DataGridViewColumn DGVC in DataGridView.Columns)
{
}
return R;
}
}
class Style : IXMLExportable
{
private string fontFamily;
public string FontFamily { get { return fontFamily; } set { fontFamily = value; } }
private int fontSize;
public int FontSize { get { return fontSize; } set { fontSize = value; } }
private int fontWeight;
public int FontWeight { get { return fontWeight; } set { fontWeight = value; } }
private int paddingLeft;
public int PaddingLeft { get { return paddingLeft; } set { paddingLeft = value; } }
private int paddingRight;
public int PaddingRight { get { return paddingRight; } set { paddingRight = value; } }
private int paddingTop;
public int PaddingTop { get { return paddingTop; } set { paddingTop = value; } }
private int paddingBottom;
public int PaddingBottom { get { return paddingBottom; } set { paddingBottom = value; } }
private Alignment textAlign;
internal Alignment TextAlign { get { return textAlign; } set { textAlign = value; } }
public string ToXml() { return ""; }
public bool IsAvailable { get { return false; } }
}
class Report : IXMLExportable
{
private int interactiveHeight; internal int InteractiveHeight { get { return interactiveHeight; } set { interactiveHeight = value; } }
private int interactiveWidth; internal int InteractiveWidth { get { return interactiveWidth; } set { interactiveWidth = value; } }
private int rightMargin; internal int RightMargin { get { return rightMargin; } set { rightMargin = value; } }
private int leftMargin; internal int LeftMargin { get { return leftMargin; } set { leftMargin = value; } }
private int bottomMargin; internal int BottomMargin { get { return bottomMargin; } set { bottomMargin = value; } }
private int width; internal int Width { get { return width; } set { width = value; } }
private string language = "en-US"; internal string Language { get { return language; } set { language = value; } }
private int topMargin; internal int TopMargin { get { return topMargin; } set { topMargin = value; } }
private DataSets dataSets; internal DataSets DataSets { get { return dataSets; } set { dataSets = value; } }
private DataSources dataSources; internal DataSources DataSources { get { return dataSources; } set { dataSources = value; } }
private Body body; internal Body Body { get { return body; } set { body = value; } }
private ReportParameters reportParameters; internal ReportParameters ReportParameters { get { return reportParameters; } set { reportParameters = value; } }
public string ToXml() { return ""; }
public bool IsAvailable { get { return true; } }
}
class DataSources : System.Collections.ObjectModel.Collection<DataSource>, IXMLExportable
{
public string ToXml() { return ""; }
public bool IsAvailable { get { return false; } }
}
class ConnectionProperties : IXMLExportable
{
private string dataProvider;
public string DataProvider { get { return dataProvider; } set { dataProvider = value; } }
private string connectString;
public string ConnectString { get { return connectString; } set { connectString = value; } }
public string ToXml() { return ""; }
public bool IsAvailable { get { return false; } }
}
class DataSource : IXMLExportable
{
private ConnectionProperties connectionProperties;
internal ConnectionProperties ConnectionProperties { get { return connectionProperties; } set { connectionProperties = value; } }
public string ToXml() { return ""; }
public bool IsAvailable { get { return false; } }
}
class DataSet : IXMLExportable
{
private string name;
public string Name { get { return name; } set { name = value; } }
private Fields fields;
internal Fields Fields { get { return fields; } set { fields = value; } }
private Query query;
internal Query Query { get { return query; } set { query = value; } }
public string ToXml() { return ""; }
public bool IsAvailable { get { return false; } }
}
class Fields : System.Collections.ObjectModel.Collection<Field>, IXMLExportable
{
public string ToXml() { return ""; }
public bool IsAvailable { get { return false; } }
}
class Field : IXMLExportable
{
private string name;
public string Name { get { return name; } set { name = value; } }
private string dataField;
public string DataField { get { return dataField; } set { dataField = value; } }
public string ToXml() { return ""; }
public bool IsAvailable { get { return false; } }
}
class Query : IXMLExportable
{
private string dataSourceName;
public string DataSourceName { get { return dataSourceName; } set { dataSourceName = value; } }
private string commandText;
public string CommandText { get { return commandText; } set { commandText = value; } }
public string ToXml() { return ""; }
public bool IsAvailable { get { return false; } }
}
class DataSets : System.Collections.ObjectModel.Collection<DataSet>, IXMLExportable
{
public string ToXml() { return ""; }
public bool IsAvailable { get { return false; } }
}
class Body : IXMLExportable
{
private int height;
public int Height { get { return height; } set { height = value; } }
private ReportItems reportItems;
internal ReportItems ReportItems { get { return reportItems; } set { reportItems = value; } }
public string ToXml() { return ""; }
public bool IsAvailable { get { return false; } }
}
class ReportItems : System.Collections.ObjectModel.Collection<ReportItem>, IXMLExportable
{
public string ToXml() { return ""; }
public bool IsAvailable { get { return false; } }
}
abstract class ReportItem : IXMLExportable
{
private Style style;
internal Style Style { get { return style; } set { style = value; } }
public abstract string ToXml();
public abstract bool IsAvailable { get; }
}
class TextBox : ReportItem, IXMLExportable
{
private int zIndex; public int ZIndex { get { return zIndex; } set { zIndex = value; } }
private bool canGrow = true; public bool CanGrow { get { return canGrow; } set { canGrow = value; } }
private string value; public string Value { get { return this.value; } set { this.value = value; } }
public override string ToXml() { return ""; }
public override bool IsAvailable { get { return false; } }
}
class ReportParameters : System.Collections.ObjectModel.Collection<ReportParameter>, IXMLExportable
{
public string ToXml() { return ""; }
public bool IsAvailable { get { return false; } }
}
class ReportParameter : IXMLExportable
{
private string dataType = "String";
public string DataType { get { return dataType; } set { dataType = value; } }
private bool allowBlank = true;
public bool AllowBlank { get { return allowBlank; } set { allowBlank = value; } }
private string prompt;
public string Prompt { get { return prompt; } set { prompt = value; } }
private string name;
public string Name { get { return name; } set { name = value; } }
public string ToXml() { return ""; }
public bool IsAvailable { get { return false; } }
}
class Table : ReportItem, IXMLExportable
{
private string name; public string Name { get { return name; } set { name = value; } }
private string dataSetName; public string DataSetName { get { return dataSetName; } set { dataSetName = value; } }
private TableSection details; internal TableSection Details { get { return details; } set { details = value; } }
private TableSection header; internal TableSection Header { get { return header; } set { header = value; } }
private TableSection footer; internal TableSection Footer { get { return footer; } set { footer = value; } }
public override string ToXml() { return ""; }
public override bool IsAvailable { get { return false; } }
}
class TableSection : System.Collections.CollectionBase
{
private TableRows tableRows; internal TableRows TableRows_ { get { return tableRows; } set { tableRows = value; } }
}
class TableRows : System.Collections.ObjectModel.Collection<TableRow>, IXMLExportable
{
#region IXMLExportable Members
public string ToXml()
{
throw new NotImplementedException();
}
public bool IsAvailable
{
get { throw new NotImplementedException(); }
}
#endregion
}
class TableRow : System.Collections.CollectionBase, IXMLExportable
{
private int height; internal int Height { get { return height; } set { height = value; } }
private TableCells tableCells; internal TableCells TableCells { get { return tableCells; } set { tableCells = value; } }
#region IXMLExportable Members
public string ToXml()
{
throw new NotImplementedException();
}
public bool IsAvailable
{
get { throw new NotImplementedException(); }
}
#endregion
}
class TableCells : System.Collections.ObjectModel.Collection<TableCell>, IXMLExportable
{
#region IXMLExportable Members
public string ToXml()
{
throw new NotImplementedException();
}
public bool IsAvailable
{
get { throw new NotImplementedException(); }
}
#endregion
}
class TableCell : System.Collections.ObjectModel.Collection<ReportItem>, IXMLExportable
{
#region IXMLExportable Members
public string ToXml()
{
throw new NotImplementedException();
}
public bool IsAvailable
{
get { throw new NotImplementedException(); }
}
#endregion
}
}
|
|
|
|
|
The below command writes not fast enough. Is there any way to fasten it.
Stored procedure is not an option for now.
It writes to Access via data reader from as400
<pre> olecmd.CommandText = "INSERT INTO NXAC08 " + "([Article], [Store], [Year], [Month], [Day],
[Unit], [Value], [Discount]) Values (" + dr["Article"].ToString() + ", " + dr["Store"].ToString()
+ ", " + dr["Year"].ToString() + ", " + dr["Mounth"].ToString() + ", " + dr["Day"].ToString() + ", "
+ dr["UNIT"] + ", " + dr["VALUE"].ToString() + ", 0)";
olecmd.ExecuteNonQuery();</pre>
|
|
|
|