|
Just got MSDN license and got c# hello world working in console mode. Now I want to load sample code but looks like a solution and I get message "one or more projects can not be located..."
file is OpenXML_SDK_HelloWorld_src.sln
Here is where I found the code:
Creation of Word 2007 document using Open XML Format SDK [^]
Creation of Word 2007 document using Open XML Format SDK
Is there some setup or other base project I need to have to open this?
I am trying to generate Word documents on the fly, with a template doc and inserting multiple lines (as in an order).
Dave
|
|
|
|
|
Did you install the Microsoft Office PIA (Primary Interop Assemblys?) Are you referencing them in your project correctly? Can we see some code? We cannot guess based off your solution name.
redistributable 2007 office PIA download[^]
|
|
|
|
|
I am mainframe programmer...bought Kernegan and Richie C book in 1980, but did not do the hello world until today...: - )
Done visual basic OO etc and worked with J D Edwards ERP with huge 50,000 line C code pgms, but this is my first .net thing. Once I get this hello world for xxx I will be off to the races. The standard console stuff does not have red wiggly underlines so I know it is recognized with my base install. But the other stuff below looks like it is not on my machine (the Open XML sdk 2.0?)
/// standard for ConsoleApplication
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
/// assembly reference or directive? DocumentFormat does not appear to be found
/// http://www.codeproject.com/KB/office/OpenXML-SDK-HelloWorld.aspx
using DocumentFormat.OpenXml;
using WindowsBase;
using DocumentFormat.OpenXml.Wordprocessing;
using DocumentFormat.OpenXml.Packaging;
using DocumentFormat.OpenXml;
|
|
|
|
|
Are you sure you referenced OpenXml properly? That's the only thing I can think of..
|
|
|
|
|
I am pretty sure that I am not referencing it correctly.... my problem is that the tutorial says this: it is easy just add a reference... (I don't even know how to code that, and when I download the code and try to open the .sln file I get project not found. Not as easy as the old hello worlds...
But the question is: how to do it in Open XML Format SDK?
It is quite easy. At the beginning it is required to add the following reference to the project:
* DocumentFormat.OpenXml
* WindowsBase
The next step is adding the following namespaces (as using) to the code file:
* DocumentFormat.OpenXml
* DocumentFormat.OpenXml.Packaging
* DocumentFormat.OpenXml.Wordprocessing
Now focus on the function that prepares word document containing "Hello World":
I did download the MS Office PIA but not sure if I got that working right either.
I will keep hacking away ...thanks for your time !
|
|
|
|
|
I installed Open XML SDK 2.0 and figured out how to add references, so all is fixed except 1 thing:
Type or Namespace WindowsBase could not be found. (are you missing a using directive or assembly reference?)
I see I have an assembly reference for this, but...
When I look at folder C:\Program Files\Reference Assemblies\Microsoft\Framework\ v3.0 I can see the dll there, but not in the v3.5 folder, and my .csproj file has a line in it <RequiredTargetFramework>3.5</RequiredTargetFramework>
so is this a pointer problem?
Do I need to install something like WindowsBase.dll into the other folder? Or qualify the using directive path somehow?
dave
|
|
|
|
|
If you look in the Solution Explorer (use View | Solution Explorer menu to open it, if it isn't already open) select the project that couldn't be located and then press F4. That will bring up the properties window for that project and the last line will contain the path where the solution file expected to find it. Change that to the actual location of the project file (whatever.csproj). An ellipsis will appear if you click on the path, clicking it will open a file browser.
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.”
|
|
|
|
|
Hi
can any one tell me how to take backup and restore of mysql through c# using ODBC connection?
regards,
Mariam
|
|
|
|
|
Like this[^]
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.
|
|
|
|
|
Thanks but they show backup of microsoft sql server while my query is related to MySQL
regards,
|
|
|
|
|
|
|
Dear Fellows,
I have an xml file
<subjects>
<publishers name="wrox">
<book>
Beginning c#
</book>
<book>
Beginning ASP.NET WITH C#
</book>
</publishers>
<publishers name="Masters">
<book>
master in c#
</book>
<book>
master ASP.NET WITH C#
</book>
</publishers>
</subjects>
First I only want to display its publishers name in datagridview. When a user press any publisher name he will be able to see name of books in datagridview below the publisher name on which he click.
You can say it as a tree view operations that I want to perform in datagridview.
I need your help to understand this problem that how can I overcome it and how I can solve it. Codes and references will certainly help alot.
I will be thankful to all those who help me.
Thank you.
Regards,
Zeeshan Ahmed.
|
|
|
|
|
I am using Ajax Timer control in my OnlineTest Application.
suppose if exam duration 45 mintes means i am adding 45 minutes to server time and i am subtracting with current server time and i will get 45 minutes with that i am reducing time in the form of seconds
like 45:59,45:58.
I am using ASP.Net 2.0,Ajax1.0, MS Access Database.
but during postback means if i click on "Next" button(next question will appear in the next page)
that time i am not able to maintain time what ever time it has taken during postback again from that i am able to continue again..please could u help me regard in this
this is my aspx page
<asp:UpdatePanel runat="server" ID="uppnlTimer" RenderMode="Inline" UpdateMode="Conditional">
<triggers>
<asp:AsyncPostBackTrigger ControlID="tmrTest" EventName="Tick" />
</triggers>
<contenttemplate>
<asp:Timer ID="tmrTest" runat="server" OnTick="tmrTest_Tick" Interval="1000">
</asp:Timer>
<asp:Label runat="server" ID="lblStartTime" Text="Start Time:" CssClass="lbl" />
<asp:Label runat="server" ID="lblStartTimeValue" CssClass="lblbold" />
<asp:HiddenField ID="hid_Ticker" runat="server" Value="0" />
</contenttemplate>
</asp:UpdatePanel>
this is Code behind code
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
DataSet dsServerTime = new DataSet();
DataSet dsExamTime = new DataSet();
dsServerTime = objOnlineTestPaperBAL.GetServerTime();
dsExamTime = objOnlineTestPaperBAL.GetServerTimeWithExamDuration(ExamTime);
if (dsServerTime.Tables[0].Rows.Count > 0)
{
string serverTime = dsExamTime.Tables[0].Rows[0]["ExamTime"].ToString();
minutes = Convert.ToInt32(serverTime);
hid_Ticker.Value = new TimeSpan(Hours, minutes, seconds).ToString();
if (Session["time"] != null)
{
string time = (string)Session["time"];
string[] str1 = time.Split(':');
minutes = Convert.ToInt32(str1[1]);
seconds = Convert.ToInt32(str1[2]);
lblStartTimeValue.Text = Convert.ToString(minutes) + " : " + Convert.ToString(seconds);
hid_Ticker.Value = new TimeSpan(Hours, minutes, seconds).ToString();
Session["time"] = hid_Ticker.Value;
}
else
{
lblStartTimeValue.Text = Convert.ToString(minutes) + " : " + Convert.ToString(seconds);
}
}
}
Session["TestStart"] = System.DateTime.Now;
}
please help me regard in this....
|
|
|
|
|
If I understood your question correctly, you do not want to penalize the user for the time it takes the Page to PostBack. Why don't you add an OnClick() event to the Next button to capture the time remaining and send it to a Session variable, first, before calling the next question, etc. Then once the page has posted back you can retrieve the time remaining from the Session variable?
Regards,
Gary
|
|
|
|
|
Hello all,
I have a little problem that I cant seem to understand, maybe someone has come across this before.
Basically I have a panel in a form. The only thing that is in this panel in 1 Label control.
The following properties have been changes:
RightToLeft set to yes
TextAlign set to TopRight
Anchor set to BottomRight
AutoSize set to true
FontStyle set to Bold
The text should say "Email Address:"
This displays in XP fine, however in Vista the text is displayed as ":Email Address"
if I set text to "Email Address:a" then it also displays fine (in both XP and Vista)
Any ideas?
Thanks
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
musefan wrote: RightToLeft set to yes
Why ? Doesn't this seem like it could be the issue ?
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
Yep
That's the problem. I set that to make sure it auto sizes in the right direction. But I will change it to default now and move the label with code if need be.
Still I would have expected all characters to be reversed thou.
Anyway, Thanks
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
Hi all,
I want to do something like this.
A collection, which is not sorted in insertion(added in the next index) and avoid duplicate. Which can I use?
Thanks.
I appreciate your help all the time...
CodingLover
|
|
|
|
|
There is no set class in .NET. You'd have to add set behaviour to a list, by searching for items and not inserting them if they exist.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
AFAIK there isn't one. You can always create your own and use new a new Add method - something like
public class MyList<T> : List<T>
{
public new void Add(T item)
{
if (!Contains(item))
base.Add(item);
}
} You'll need to do something similar for AddRange, and keep track of any changing items to make sure they don't create duplicates.
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)
|
|
|
|
|
There is library available from Wintellect that has unordered set, the one you are looking for. You might try it if you wish.
|
|
|
|
|
It's worth remembering that there isn't a one-size-fits all algorithm to do stuff like this. The framework provides a set of general purpose collections and algorithms, but they might not be good enough in specific scenarios.
An unsorted list, which is what I understand you want, is going to be very slow at detecting duplicates. And its going to seriously degrade if you've got lots and lots of things in your collection. It might be worth running two data structures alongside each other to mitigate this.
So, roughly how many things are you going to insert into this? Is memory consumption an issue for you? Can we remove duplicates later on, or does it have to be done on insertion?
Regards,
Rob Philpott.
|
|
|
|
|
If you can use .NET 3.5, there is an HashSet class.
Otherwise, you have to build one, as others have said.
|
|
|
|
|