|
no.. it's auto defined
i am using the auto defined columns for long time but this is the first time i face such a problem.
|
|
|
|
|
Before setting the DataSource for dataVehicles, use the debugger and check that the data_table is holding columns in right order (the order you have defined in sp), just in case that they arrive correctly.
If that doesn't explain this, add following lines before setting datasource to test if any of them help:
...
sql_adapter.Fill(data_table);
dataVehicles.DataSource = null;
dataVehicles.Columns.Clear();
dataVehicles.ResetBindings();
dataVehicles.DataSource = data_table;
...
|
|
|
|
|
checking the data_table shows that it's binding columns in the incorrect order agaist the order in the sp.
so i tried the code you mentioned and it worked fine.
thank you
|
|
|
|
|
You're welcome
|
|
|
|
|
Hi all..
Can anyone brief me with some examples to crawl repository from sharepoint server..
As i am new to sharepoint and as well as c#...I dont have idea regarding what exactly is Repository in sharepoint server...can anyone provide me site.....
thank you...in advance..
manju
Hi..
I am Mnaju.I have Completed my B.E Computers Science.Lokking for a job.I am interested in VC++
manju
|
|
|
|
|
How can i get automatic scroll bar in this project.http://www.codeproject.com/KB/graphics/PanZoom2.aspx?msg=2672101#xx2672101xx
sorry for posting link in this.
Regards,
ALGATES
|
|
|
|
|
|
i have different web applications i merge them and add them in a setup project i also add some custom actions in the setup. i have build and install the setup. It is done succesfully but my custom action doesnot work. I have a dialogue box which i want to show during installation for database generation but it doesnot appear. What is the solution. I am using vs 2008-with c#
tahir
|
|
|
|
|
Don't cross post to multiple forums as it is considered rude. The people here answer questions on a volunteer basis and may not respond in a timeframe you desire or find acceptable, and posting to multiple forums will not help you receive an answer any faster.
Original post: http://www.codeproject.com/script/Forums/View.aspx?fid=3831&msg=2700975[^]
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
|
|
|
|
|
Hi,
I'm having some trouble cleaning up an application that automates Excel. I end up with multiple instances of Excel open...
What I have is three classes...
An "excel" class (Holds the excel COM object etc)
A control panel (Allows user to navigate through excel records)
A display panel (Displays the excel records)
I pass the Excel object to the other two panels using an interface (IExcel).
The Excel object has a Dispose method, and it cleans itself up when the user is finished.
When I click the cancel button in the control panel, I dispose of the excel object, but the instance isn't closing... So I think I may be missing some basics...
If I pass an object as an interface to another object, and then dispose of the original object, does that clean up everything else (i.e the interfaces I passed)?
Mark Brock
"We're definitely not going to make a G or a PG version of this. It's not PillowfightCraft." -- Chris Metzen
Click here to view my blog
|
|
|
|
|
Since you are using the old COM interfaces to access Excel there is probably an explicit Close (or something similar) on the object that you need to call. When dealing with the office COM objects, calling Dispose is no guarantee that the COM side of things is going to automatically do the right thing.
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
|
|
|
|
|
Hi Scott,
The dispose method is written by me, and contains all the explicit calls to close the Excel application correctly (assuming MSDN is correct).
Scott Dorman wrote: Since you are using the old COM interfaces to access Excel
What do you mean? Is there a newer/better approach?
Cheers,
Mark.
Mark Brock
"We're definitely not going to make a G or a PG version of this. It's not PillowfightCraft." -- Chris Metzen
Click here to view my blog
|
|
|
|
|
MarkBrock wrote: What do you mean? Is there a newer/better approach?
Well, I'm assuming you aren't using the functionality from VSTO so that would probably be a good place to start.
MarkBrock wrote: The dispose method is written by me, and contains all the explicit calls to close the Excel application correctly (assuming MSDN is correct).
So if I understand this correctly, your "excel" object is a custom class you wrote that wraps the COM object and it is this class that you are passing to the other objects/methods? How have you written the dispose method? Are you implementing the IDisposable interface and the Dispose pattern properly?
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
|
|
|
|
|
Hi,
Yes by Excel object is custom class that wraps the COM object, and contains all the methods for getting information from Excel.
I'm not implementing IDisposable, The IExcel interface declares the dispose method.
If I call dispose from the 'excel' object it cleans up fine, however if I call it from an IExcel instance then it is not.
My dispose procedure is implemented as below:
<br />
<br />
public void Dispose()<br />
{<br />
try<br />
{<br />
this.Cleanup(this.sheet);<br />
this.workBook.Close(false, null, null);<br />
this.Cleanup(this.workBook);<br />
this.application.Quit();<br />
this.Cleanup(this.application);<br />
}<br />
catch (Exception) { }<br />
}<br />
<br />
private void Cleanup(object o)<br />
{<br />
try<br />
{<br />
System.Runtime.InteropServices.Marshal.ReleaseComObject(o);<br />
}<br />
catch { }<br />
finally<br />
{<br />
o = null;<br />
}<br />
}<br />
Cheers,
Mark Brock
"We're definitely not going to make a G or a PG version of this. It's not PillowfightCraft." -- Chris Metzen
Click here to view my blog
|
|
|
|
|
Is the IExcel interface also something you created? You really should implement this using IDisposable as well. Take a look at this article[^] for more information.
I'm not sure why you are getting different behavior when calling this on the interface instance as that shouldn't cause any problems. Try changing your code to implement the dispose pattern and see if you get any better behavior. (Even if you don't, you will still be in a better position as you are working with the GC in a much better manner.)
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
|
|
|
|
|
I just moved a project of mine from the Express edition of Web Developer 2008 to VS 2008, and i have an odd issue. I have a class that was previously that had no namespace before, as with several other classes in the project. Since adding them all to the project, I have added them all to the namespace of the project, we'll say MarvelUniverse for the purposes of the post. Now, every other class works just fine, but the class MarvelSQL is not showing up or available.
It is a public partial class generated with sqlmetal, but aside from that, it is identical to the other classes, and even the other public partial classes (including the page classes, like _Default, are visible...)
Any ideas? This has been driving me nuts...
______________________
Oh Hamburgers!
|
|
|
|
|
Here's my problem. I have this line of code in an unsafe context:
TreeNode* Current = null;
it gives me an error that says "Cannot take the address of, get the size of, or declare a pointer to a managed type ("System.Windows.Forms.TreeNode")"
The C++ equivalent of that line would be
System::Windows::Forms::TreeNode *Current = 0;
and in C++, i can avoid that error by using the '^' operator like so
System::Windows::Forms::TreeNode^ *Current = 0;
however, i know little to nothing about C++, and i have no idea what the '^' operator does. If anyone knows a way to implement this in C#, please let me know.
void Play() { try { throw Ball(); } catch (Glove) { } finally { Play(); } }
"Failure is only the opportunity to begin again, this time more wisely."
"Don't ask for a light load, but rather ask for a strong back."
|
|
|
|
|
C++ won't help here.
You can't take the address of a managed object in either language.
In C++/CLI, ^ indicates a handle to a managed object. You can get the
address of the handle but not the address of the object.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
To get a pointer to an object on the heap, you have to fix in to a specific address so that the garbage collector is no longer allowed to move it around in memory:
fixed (TreeNode* Current = null) {
}
Why do you need a pointer to a TreeNode anyway?
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Hi Pros, I have a question that is I am custom drawing the listbox items. What i want an i-beam/or cursor to be blink between each items. So if say there are 4 items and I click between item 2 and 3 the i-beam should be flashing between item 2 and 3. Is there any way to do get this sort of result.
I appreciate your inputs. Thanks
|
|
|
|
|
If you want to control mouse cursor, I think you have two possibilities:
- use I-beam cursor (Cursor.Current Property [^]) and Cursor.Hide Method[^] via timer
- create your own animated cursor. However, .Net framework does not support animated cursors directly so I believe you should use non-managed code in this case
Mika
|
|
|
|
|
I need to get list of all fields referenced in RDL report.
It seems that Field references are prefixed with Fields! prefix
Field name constains letters, number and underscores.
RDL format is XML, sample below.
Maybe simplest is to treat it as txt file and parse character by character:
1. Find all characters containing Fields!
2. Extract identifier after Fields! characters
Result from file below should be:
Continent
Name
Code
...
Any idea how to implement this ?
Andrus.
<?xml version="1.0" encoding="UTF-8"?>
<Report Name="WorldFacts">
<Description>Worlds Facts - test data from MySQL World database</Description>
<DataElementStyle>ElementNormal</DataElementStyle>
<LeftMargin>.4in</LeftMargin>
<RightMargin>.4in</RightMargin>
<TopMargin>.5in</TopMargin>
<BottomMargin>.5in</BottomMargin>
<DataSources>
<DataSource Name="DS1">
<ConnectionProperties>
<DataProvider>xxx</DataProvider>
<!-- Use this line when using xml data -->
<ConnectString>dsn=world;UID=uuu;PWD=ppp;</ConnectString>
</ConnectionProperties>
</DataSource>
</DataSources>
<DataSets>
<DataSet Name="Data">
<Query>
<DataSourceName>DS1</DataSourceName>
<!-- <CommandText>SELECT Code, Name, Continent, Region, Population, IndepYear, SurfaceArea FROM Country</CommandText> -->
</Query>
<Fields>
<Field Name="Code">
<DataField>Code</DataField>
<TypeName>String</TypeName>
</Field>
<Field Name="Name">
<DataField>Name</DataField>
<TypeName>String</TypeName>
</Field>
<Field Name="Continent">
<DataField>Continent</DataField>
<TypeName>String</TypeName>
</Field>
<Field Name="Region">
<DataField>Region</DataField>
<TypeName>String</TypeName>
</Field>
<Field Name="Population">
<DataField>Population</DataField>
<TypeName>Float</TypeName>
</Field>
<Field Name="IndependenceYear">
<DataField>IndependenceYear</DataField>
<TypeName>Float</TypeName>
</Field>
<Field Name="SurfaceArea">
<DataField>SurfaceArea</DataField>
<TypeName>Float</TypeName>
</Field>
</Fields>
<Rows File="WorldFacts.xml" />
</DataSet>
</DataSets>
<PageHeader>
<Height>.5 in</Height>
<ReportItems>
<Textbox Name="Textbox1">
<Top>.1 in</Top>
<Left>.1 in</Left>
<Height>.25 in</Height>
<Value>The World's Countries</Value>
<Style>
<FontSize>15pt</FontSize>
<FontWeight>Bold</FontWeight>
</Style>
</Textbox>
</ReportItems>
<PrintOnFirstPage>True</PrintOnFirstPage>
<PrintOnLastPage>True</PrintOnLastPage>
</PageHeader>
<Body>
<Height>64.4pt</Height>
<ReportItems>
<Table Name="Table1">
<DetailDataElementName>Row</DetailDataElementName>
<DetailDataCollectionName>Rows</DetailDataCollectionName>
<Style>
<BorderStyle>
<Default>Solid</Default>
</BorderStyle>
</Style>
<TableColumns>
<TableColumn>
<Width>.75 in</Width>
</TableColumn>
<TableColumn>
<Width>.5 in</Width>
</TableColumn>
<TableColumn>
<Width>2.5 in</Width>
</TableColumn>
<TableColumn>
<Width>1 in</Width>
</TableColumn>
<TableColumn>
<Width>1 in</Width>
</TableColumn>
<TableColumn>
<Width>1 in</Width>
</TableColumn>
<TableColumn>
<Width>1 in</Width>
</TableColumn>
</TableColumns>
<Header>
<TableRows>
<TableRow>
<Height>12 pt</Height>
<TableCells>
<TableCell>
<ReportItems>
<Textbox Name="Textbox2">
<Value>Continent</Value>
<Style>
<PaddingLeft>2 pt</PaddingLeft>
<BorderStyle>
<Default>Solid</Default>
</BorderStyle>
<FontWeight>Bold</FontWeight>
</Style>
</Textbox>
</ReportItems>
</TableCell>
<TableCell>
<ReportItems>
<Textbox Name="Textbox3">
<Value>Code</Value>
<Style>
<PaddingLeft>2 pt</PaddingLeft>
<BorderStyle>
<Default>Solid</Default>
</BorderStyle>
<FontWeight>Bold</FontWeight>
</Style>
</Textbox>
</ReportItems>
</TableCell>
<TableCell>
<ReportItems>
<Textbox Name="Textbox4">
<Value>Name</Value>
<Style>
<PaddingLeft>2 pt</PaddingLeft>
<BorderStyle>
<Default>Solid</Default>
</BorderStyle>
<FontWeight>Bold</FontWeight>
</Style>
</Textbox>
</ReportItems>
</TableCell>
<TableCell>
<ReportItems>
<Textbox Name="Textbox5">
<Value>Region</Value>
<Style>
<PaddingLeft>2 pt</PaddingLeft>
<BorderStyle>
<Default>Solid</Default>
</BorderStyle>
<FontWeight>Bold</FontWeight>
</Style>
</Textbox>
</ReportItems>
</TableCell>
<TableCell>
<ReportItems>
<Textbox Name="Textbox6">
<Value>Population</Value>
<Style>
<PaddingLeft>2 pt</PaddingLeft>
<BorderStyle>
<Default>Solid</Default>
</BorderStyle>
<FontWeight>Bold</FontWeight>
</Style>
</Textbox>
</ReportItems>
</TableCell>
<TableCell>
<ReportItems>
<Textbox Name="Textbox7">
<Value>Independence</Value>
<Style>
<PaddingLeft>2 pt</PaddingLeft>
<BorderStyle>
<Default>Solid</Default>
</BorderStyle>
<FontWeight>Bold</FontWeight>
</Style>
</Textbox>
</ReportItems>
</TableCell>
<TableCell>
<ReportItems>
<Textbox Name="Textbox8">
<Value>Surface Area</Value>
<Style>
<PaddingLeft>2 pt</PaddingLeft>
<BorderStyle>
<Default>Solid</Default>
</BorderStyle>
<FontWeight>Bold</FontWeight>
</Style>
</Textbox>
</ReportItems>
</TableCell>
</TableCells>
</TableRow>
</TableRows>
<RepeatOnNewPage>true</RepeatOnNewPage>
</Header>
<TableGroups>
<TableGroup>
<Header>
<TableRows>
<TableRow>
<Height>12 pt</Height>
<TableCells>
<TableCell>
<ColSpan>7</ColSpan>
<ReportItems>
<Textbox Name="Textbox9">
<Value>=Fields.Continent.Value</Value>
<Style>
<PaddingLeft>2 pt</PaddingLeft>
<BorderStyle>
<Default>Solid</Default>
</BorderStyle>
<FontWeight>Bold</FontWeight>
</Style>
</Textbox>
</ReportItems>
</TableCell>
</TableCells>
</TableRow>
</TableRows>
<RepeatOnNewPage>true</RepeatOnNewPage>
</Header>
<Footer>
<TableRows>
<TableRow>
<Height>12 pt</Height>
<TableCells>
<TableCell>
<ColSpan>7</ColSpan>
<ReportItems>
<Textbox Name="Textbox14">
<Value>="Count of countries in " + Fields.Continent.Value + " = " +Count(Fields.Name.Value)</Value>
<Style>
<PaddingLeft>2 pt</PaddingLeft>
<BorderStyle>
<Default>Solid</Default>
</BorderStyle>
<FontWeight>Bold</FontWeight>
</Style>
</Textbox>
</ReportItems>
</TableCell>
</TableCells>
</TableRow>
</TableRows>
</Footer>
<Grouping Name="ContinentGroup">
<GroupExpressions>
<GroupExpression>=Fields!Continent.Value</GroupExpression>
</GroupExpressions>
</Grouping>
</TableGroup>
</TableGroups>
<Details>
<Sorting>
<SortBy>
<SortExpression>=Fields!Name.Value</SortExpression>
</SortBy>
</Sorting>
<TableRows>
<TableRow>
<Height>12 pt</Height>
<TableCells>
<TableCell>
<ReportItems>
<Textbox Name="Textbox10">
<Value>
</Value>
<Style>
<PaddingLeft>2 pt</PaddingLeft>
<BorderStyle>
<Default>Solid</Default>
<Bottom>None</Bottom>
<Top>None</Top>
</BorderStyle>
</Style>
</Textbox>
</ReportItems>
</TableCell>
<TableCell>
<ReportItems>
<Textbox Name="Code">
<Value>=Fields!Code.Value</Value>
<Style>
<PaddingLeft>2 pt</PaddingLeft>
<BorderStyle>
<Default>Solid</Default>
</BorderStyle>
</Style>
</Textbox>
</ReportItems>
</TableCell>
<TableCell>
<ReportItems>
<Textbox Name="Name">
<CanGrow>true</CanGrow>
<Value>=Fields!Name.Value</Value>
<Style>
<PaddingLeft>2 pt</PaddingLeft>
<BorderStyle>
<Default>Solid</Default>
</BorderStyle>
</Style>
</Textbox>
</ReportItems>
</TableCell>
<TableCell>
<ReportItems>
<Textbox Name="Region">
<CanGrow>true</CanGrow>
<Value>=Fields!Region.Value</Value>
<Style>
<PaddingLeft>2 pt</PaddingLeft>
<BorderStyle>
<Default>Solid</Default>
</BorderStyle>
</Style>
</Textbox>
</ReportItems>
</TableCell>
<TableCell>
<ReportItems>
<Textbox Name="Textbox11">
<Value>=Fields!Population.Value</Value>
<Style>
<Format>#,##0</Format>
<TextAlign>Right</TextAlign>
<PaddingRight>2 pt</PaddingRight>
<BorderStyle>
<Default>Solid</Default>
</BorderStyle>
</Style>
</Textbox>
</ReportItems>
</TableCell>
<TableCell>
<ReportItems>
<Textbox Name="Textbox12">
<Value>=switch(Fields!IndependenceYear.Value = 0, "", Fields!IndependenceYear.Value > 0, Fields!IndependenceYear.Value, true, -Fields!IndependenceYear.Value + " BC")</Value>
<Style>
<Format>0000</Format>
<TextAlign>Center</TextAlign>
<BorderStyle>
<Default>Solid</Default>
</BorderStyle>
</Style>
</Textbox>
</ReportItems>
</TableCell>
<TableCell>
<ReportItems>
<Textbox Name="Textbox13">
<Value>=Fields!SurfaceArea.Value</Value>
<Style>
<Format>#,##0</Format>
<TextAlign>Right</TextAlign>
<PaddingRight>2 pt</PaddingRight>
<BorderStyle>
<Default>Solid</Default>
</BorderStyle>
</Style>
</Textbox>
</ReportItems>
</TableCell>
</TableCells>
</TableRow>
</TableRows>
</Details>
<Footer>
<TableRows>
<TableRow>
<Height>12 pt</Height>
<TableCells>
<TableCell>
<ColSpan>4</ColSpan>
<ReportItems>
<Textbox Name="Textbox15">
<Value>=CountDistinct(Fields.Continent.Value) + " continents. " + Count(Fields.Name.Value)+ " countries." </Value>
<Style>
<PaddingLeft>2 pt</PaddingLeft>
<BorderStyle>
<Default>Solid</Default>
</BorderStyle>
<FontWeight>Bold</FontWeight>
</Style>
</Textbox>
</ReportItems>
</TableCell>
<TableCell>
<ColSpan>1</ColSpan>
<ReportItems>
<Textbox Name="Textbox16">
<Value>=Sum(Fields.Population.Value)</Value>
<Style>
<Format>#,##0</Format>
<TextAlign>Right</TextAlign>
<PaddingRight>2 pt</PaddingRight>
<BorderStyle>
<Default>Solid</Default>
</BorderStyle>
<FontWeight>Bold</FontWeight>
</Style>
</Textbox>
</ReportItems>
</TableCell>
<TableCell>
<ColSpan>1</ColSpan>
<ReportItems>
<Textbox Name="Textbox17">
<Value>
</Value>
<Style>
<Format>#,##0</Format>
<TextAlign>Right</TextAlign>
<PaddingRight>2 pt</PaddingRight>
<BorderStyle>
<Default>Solid</Default>
</BorderStyle>
<FontWeight>Bold</FontWeight>
</Style>
</Textbox>
</ReportItems>
</TableCell>
<TableCell>
<ColSpan>1</ColSpan>
<ReportItems>
<Textbox Name="Textbox18">
<Value>=Sum(Fields.SurfaceArea.Value)</Value>
<Style>
<Format>#,##0</Format>
<TextAlign>Right</TextAlign>
<PaddingRight>2 pt</PaddingRight>
<BorderStyle>
<Default>Solid</Default>
</BorderStyle>
<FontWeight>Bold</FontWeight>
</Style>
</Textbox>
</ReportItems>
</TableCell>
</TableCells>
</TableRow>
</TableRows>
</Footer>
</Table>
</ReportItems>
<Columns>1</Columns>
</Body>
<PageFooter>
<Height>0pt</Height>
<PrintOnFirstPage>True</PrintOnFirstPage>
<PrintOnLastPage>True</PrintOnLastPage>
</PageFooter>
<Width>7in</Width>
<PageWidth>8.5in</PageWidth>
<PageHeight>11in</PageHeight>
<DataElementName>Report</DataElementName>
</Report>
Andrus
|
|
|
|
|
Try reading the file into XmlDocument class and then use SelectNodes method (querying for 'Field'). After this you should have a node list and you can extract Name attribute for each node.
Mika
|
|
|
|
|
I havent never used this.
Can you provide come example ?
node values can contain expressions like
Fields!myfield + "Fields!ddddd"
from this expression I need to extract only
myfield name.
How to extract field names from node values ?
Andrus
|
|
|
|
|
This should get you going.
string xmlText = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><Report Name=\"WorldFacts\"> <Description>Worlds Facts - test data from MySQL World database</Description> <DataElementStyle>ElementNormal</DataElementStyle> <LeftMargin>.4in</LeftMargin> <RightMargin>.4in</RightMargin> <TopMargin>.5in</TopMargin> <BottomMargin>.5in</BottomMargin> <DataSources> <DataSource Name=\"DS1\"> <ConnectionProperties> <DataProvider>xxx</DataProvider> <!-- Use this line when using xml data --> <ConnectString>dsn=world;UID=uuu;PWD=ppp;</ConnectString> </ConnectionProperties> </DataSource> </DataSources> <DataSets> <DataSet Name=\"Data\"> <Query> <DataSourceName>DS1</DataSourceName> <!-- <CommandText>SELECT Code, Name, Continent, Region, Population, IndepYear, SurfaceArea FROM Country</CommandText> --> </Query> <Fields> <Field Name=\"Code\"> <DataField>Code</DataField> <TypeName>String</TypeName> </Field> <Field Name=\"Name\"> <DataField>Name</DataField> <TypeName>String</TypeName> </Field> <Field Name=\"Continent\"> <DataField>Continent</DataField> <TypeName>String</TypeName> </Field> <Field Name=\"Region\"> <DataField>Region</DataField> <TypeName>String</TypeName> </Field> <Field Name=\"Population\"> <DataField>Population</DataField> <TypeName>Float</TypeName> </Field> <Field Name=\"IndependenceYear\"> <DataField>IndependenceYear</DataField> <TypeName>Float</TypeName> </Field> <Field Name=\"SurfaceArea\"> <DataField>SurfaceArea</DataField> <TypeName>Float</TypeName> </Field> </Fields> <Rows File=\"WorldFacts.xml\" /> </DataSet> </DataSets> <PageHeader> <Height>.5 in</Height> <ReportItems> <Textbox Name=\"Textbox1\"> <Top>.1 in</Top> <Left>.1 in</Left> <Height>.25 in</Height> <Value>The World's Countries</Value> <Style> <FontSize>15pt</FontSize> <FontWeight>Bold</FontWeight> </Style> </Textbox> </ReportItems> <PrintOnFirstPage>True</PrintOnFirstPage> <PrintOnLastPage>True</PrintOnLastPage> </PageHeader> <Body> <Height>64.4pt</Height> <ReportItems> <Table Name=\"Table1\"> <DetailDataElementName>Row</DetailDataElementName> <DetailDataCollectionName>Rows</DetailDataCollectionName> <Style> <BorderStyle> <Default>Solid</Default> </BorderStyle> </Style> <TableColumns> <TableColumn> <Width>.75 in</Width> </TableColumn> <TableColumn> <Width>.5 in</Width> </TableColumn> <TableColumn> <Width>2.5 in</Width> </TableColumn> <TableColumn> <Width>1 in</Width> </TableColumn> <TableColumn> <Width>1 in</Width> </TableColumn> <TableColumn> <Width>1 in</Width> </TableColumn> <TableColumn> <Width>1 in</Width> </TableColumn> </TableColumns> <Header> <TableRows> <TableRow> <Height>12 pt</Height> <TableCells> <TableCell> <ReportItems> <Textbox Name=\"Textbox2\"> <Value>Continent</Value> <Style> <PaddingLeft>2 pt</PaddingLeft> <BorderStyle> <Default>Solid</Default> </BorderStyle> <FontWeight>Bold</FontWeight> </Style> </Textbox> </ReportItems> </TableCell> <TableCell> <ReportItems> <Textbox Name=\"Textbox3\"> <Value>Code</Value> <Style> <PaddingLeft>2 pt</PaddingLeft> <BorderStyle> <Default>Solid</Default> </BorderStyle> <FontWeight>Bold</FontWeight> </Style> </Textbox> </ReportItems> </TableCell> <TableCell> <ReportItems> <Textbox Name=\"Textbox4\"> <Value>Name</Value> <Style> <PaddingLeft>2 pt</PaddingLeft> <BorderStyle> <Default>Solid</Default> </BorderStyle> <FontWeight>Bold</FontWeight> </Style> </Textbox> </ReportItems> </TableCell> <TableCell> <ReportItems> <Textbox Name=\"Textbox5\"> <Value>Region</Value> <Style> <PaddingLeft>2 pt</PaddingLeft> <BorderStyle> <Default>Solid</Default> </BorderStyle> <FontWeight>Bold</FontWeight> </Style> </Textbox> </ReportItems> </TableCell> <TableCell> <ReportItems> <Textbox Name=\"Textbox6\"> <Value>Population</Value> <Style> <PaddingLeft>2 pt</PaddingLeft> <BorderStyle> <Default>Solid</Default> </BorderStyle> <FontWeight>Bold</FontWeight> </Style> </Textbox> </ReportItems> </TableCell> <TableCell> <ReportItems> <Textbox Name=\"Textbox7\"> <Value>Independence</Value> <Style> <PaddingLeft>2 pt</PaddingLeft> <BorderStyle> <Default>Solid</Default> </BorderStyle> <FontWeight>Bold</FontWeight> </Style> </Textbox> </ReportItems> </TableCell> <TableCell> <ReportItems> <Textbox Name=\"Textbox8\"> <Value>Surface Area</Value> <Style> <PaddingLeft>2 pt</PaddingLeft> <BorderStyle> <Default>Solid</Default> </BorderStyle> <FontWeight>Bold</FontWeight> </Style> </Textbox> </ReportItems> </TableCell> </TableCells> </TableRow> </TableRows> <RepeatOnNewPage>true</RepeatOnNewPage> </Header> <TableGroups> <TableGroup> <Header> <TableRows> <TableRow> <Height>12 pt</Height> <TableCells> <TableCell> <ColSpan>7</ColSpan> <ReportItems> <Textbox Name=\"Textbox9\"> <Value>=Fields.Continent.Value</Value> <Style> <PaddingLeft>2 pt</PaddingLeft> <BorderStyle> <Default>Solid</Default> </BorderStyle> <FontWeight>Bold</FontWeight> </Style> </Textbox> </ReportItems> </TableCell> </TableCells> </TableRow> </TableRows> <RepeatOnNewPage>true</RepeatOnNewPage> </Header> <Footer> <TableRows> <TableRow> <Height>12 pt</Height> <TableCells> <TableCell> <ColSpan>7</ColSpan> <ReportItems> <Textbox Name=\"Textbox14\"> <Value>=\"Count of countries in \" + Fields.Continent.Value + \" = \" +Count(Fields.Name.Value)</Value> <Style> <PaddingLeft>2 pt</PaddingLeft> <BorderStyle> <Default>Solid</Default> </BorderStyle> <FontWeight>Bold</FontWeight> </Style> </Textbox> </ReportItems> </TableCell> </TableCells> </TableRow> </TableRows> </Footer> <Grouping Name=\"ContinentGroup\"> <GroupExpressions> <GroupExpression>=Fields!Continent.Value</GroupExpression> </GroupExpressions> </Grouping> </TableGroup> </TableGroups> <Details> <Sorting> <SortBy> <SortExpression>=Fields!Name.Value</SortExpression> </SortBy> </Sorting> <TableRows> <TableRow> <Height>12 pt</Height> <TableCells> <TableCell> <ReportItems> <Textbox Name=\"Textbox10\"> <Value> </Value> <Style> <PaddingLeft>2 pt</PaddingLeft> <BorderStyle> <Default>Solid</Default> <Bottom>None</Bottom> <Top>None</Top> </BorderStyle> </Style> </Textbox> </ReportItems> </TableCell> <TableCell> <ReportItems> <Textbox Name=\"Code\"> <Value>=Fields!Code.Value</Value> <Style> <PaddingLeft>2 pt</PaddingLeft> <BorderStyle> <Default>Solid</Default> </BorderStyle> </Style> </Textbox> </ReportItems> </TableCell> <TableCell> <ReportItems> <Textbox Name=\"Name\"> <CanGrow>true</CanGrow> <Value>=Fields!Name.Value</Value> <Style> <PaddingLeft>2 pt</PaddingLeft> <BorderStyle> <Default>Solid</Default> </BorderStyle> </Style> </Textbox> </ReportItems> </TableCell> <TableCell> <ReportItems> <Textbox Name=\"Region\"> <CanGrow>true</CanGrow> <Value>=Fields!Region.Value</Value> <Style> <PaddingLeft>2 pt</PaddingLeft> <BorderStyle> <Default>Solid</Default> </BorderStyle> </Style> </Textbox> </ReportItems> </TableCell> <TableCell> <ReportItems> <Textbox Name=\"Textbox11\"> <Value>=Fields!Population.Value</Value> <Style> <Format>#,##0</Format> <TextAlign>Right</TextAlign> <PaddingRight>2 pt</PaddingRight> <BorderStyle> <Default>Solid</Default> </BorderStyle> </Style> </Textbox> </ReportItems> </TableCell> <TableCell> <ReportItems> <Textbox Name=\"Textbox12\"> <Value>=switch(Fields!IndependenceYear.Value = 0, \"\", Fields!IndependenceYear.Value > 0, Fields!IndependenceYear.Value, true, -Fields!IndependenceYear.Value + \" BC\")</Value> <Style> <Format>0000</Format> <TextAlign>Center</TextAlign> <BorderStyle> <Default>Solid</Default> </BorderStyle> </Style> </Textbox> </ReportItems> </TableCell> <TableCell> <ReportItems> <Textbox Name=\"Textbox13\"> <Value>=Fields!SurfaceArea.Value</Value> <Style> <Format>#,##0</Format> <TextAlign>Right</TextAlign> <PaddingRight>2 pt</PaddingRight> <BorderStyle> <Default>Solid</Default> </BorderStyle> </Style> </Textbox> </ReportItems> </TableCell> </TableCells> </TableRow> </TableRows> </Details> <Footer> <TableRows> <TableRow> <Height>12 pt</Height> <TableCells> <TableCell> <ColSpan>4</ColSpan> <ReportItems> <Textbox Name=\"Textbox15\"> <Value>=CountDistinct(Fields.Continent.Value) + \" continents. \" + Count(Fields.Name.Value)+ \" countries.\" </Value> <Style> <PaddingLeft>2 pt</PaddingLeft> <BorderStyle> <Default>Solid</Default> </BorderStyle> <FontWeight>Bold</FontWeight> </Style> </Textbox> </ReportItems> </TableCell> <TableCell> <ColSpan>1</ColSpan> <ReportItems> <Textbox Name=\"Textbox16\"> <Value>=Sum(Fields.Population.Value)</Value> <Style> <Format>#,##0</Format> <TextAlign>Right</TextAlign> <PaddingRight>2 pt</PaddingRight> <BorderStyle> <Default>Solid</Default> </BorderStyle> <FontWeight>Bold</FontWeight> </Style> </Textbox> </ReportItems> </TableCell> <TableCell> <ColSpan>1</ColSpan> <ReportItems> <Textbox Name=\"Textbox17\"> <Value> </Value> <Style> <Format>#,##0</Format> <TextAlign>Right</TextAlign> <PaddingRight>2 pt</PaddingRight> <BorderStyle> <Default>Solid</Default> </BorderStyle> <FontWeight>Bold</FontWeight> </Style> </Textbox> </ReportItems> </TableCell> <TableCell> <ColSpan>1</ColSpan> <ReportItems> <Textbox Name=\"Textbox18\"> <Value>=Sum(Fields.SurfaceArea.Value)</Value> <Style> <Format>#,##0</Format> <TextAlign>Right</TextAlign> <PaddingRight>2 pt</PaddingRight> <BorderStyle> <Default>Solid</Default> </BorderStyle> <FontWeight>Bold</FontWeight> </Style> </Textbox> </ReportItems> </TableCell> </TableCells> </TableRow> </TableRows> </Footer> </Table> </ReportItems> <Columns>1</Columns> </Body> <PageFooter> <Height>0pt</Height> <PrintOnFirstPage>True</PrintOnFirstPage> <PrintOnLastPage>True</PrintOnLastPage> </PageFooter> <Width>7in</Width> <PageWidth>8.5in</PageWidth> <PageHeight>11in</PageHeight> <DataElementName>Report</DataElementName></Report>";
System.Xml.XmlDocument xmlDoc = new System.Xml.XmlDocument();
System.Xml.XmlNodeList selectedNodes;
xmlDoc.LoadXml(xmlText);
selectedNodes = xmlDoc.SelectNodes("Report/DataSets/DataSet/Fields/Field");
foreach (System.Xml.XmlNode xmlNode in selectedNodes) {
System.Windows.Forms.MessageBox.Show(xmlNode.Attributes["Name"].Value);
}
|
|
|
|
|