|
Hi world !
I have a strange need today : create an Excel file without Microsoft Office installed on computer.
I work on a WinForm application wrote in C# using .Net 1.1.xxxx.
> I need to be able to create a new .xls file, with some data generated in a progamm loop
> I also need to set the BackGround color for some cells
And the generated file must be directly openable in Excell ( with a double click for exemple : the file is a valid .xls file )
I've think about XML format, but cannot found full description to allow cells BackGroundColor custom.
Thanks in advance if someone have a genius idea ! ...
PS: Sorry if this post isn't in the correct forum ...
Have a nice day.
Sebastien.
|
|
|
|
|
You could look at the open office source for information about how the .xls binary is structured. Good luck. From what I've heard the office binary formats are full of nasty gotchas.
|
|
|
|
|
That's a good idea ! Thanks
... maybe someone have ever write a dll, or ?!
I think browse OpenOffice source code is a big task !!!
Arrghhhh ... Life is hard ...
|
|
|
|
|
I've never used this thing[^] but it looks like it does what you need. Don't yell at me if it sucks!
Josh
|
|
|
|
|
I want to, after deployement of the application, modify the resources of my application. Let say you have a windows form with a button that has a name but you want the user to have the posibility to modify it. Since resources are compile in dll, it is a bit tricky. I have explore two possibilities:
1- I've tried to implement my own resource manager that I would replace in my form where as :
System.ComponentModel.ComponentResourceManager resources = myresourcemanager;
The ComponentResourceManager inherit from ResourceManager and add the ApplyResource method. I can easly derive from ComponentResourceManager, but I have a hard time changing the ResourceManager that it derive from.
I would like to modify only one line of code since it is in the Designer class. And that would leave me the IDE functionnality to generate resources.
I found this article : http://www.codeproject.com/aspnet/customsqlserverprovider.asp that is nice but is for asp and I'm missing information to fill the gap.
2- Uses uncompile resource at runtime that I would be able to modify. I found somewhere that it is possible with asp but didn't find much information about it.
Any ideas?
Thanks
-Archambault
-- modified at 11:59 Thursday 15th June, 2006
|
|
|
|
|
Hi,
When using webservice, I have the time like that:
"2006-06-15T12:10:09Z"
I can't understand it? Is it universal time? "T" & "Z" mean?
Thanks for your help!
Hung
|
|
|
|
|
T is apparently a delimiter between the date and time. Z stands for Zulu which is an alternate name for universal time (UTC), and practically equivilant to GMT. There are a few differences between UTC and the older GMT standard but unless you're a clock geek they're meaningless.
|
|
|
|
|
Hi,
What are a few .Net data structures let you manipulate several objects of data through a single variable name ?
Name at least 1 in both the System.Collections namespace and System.Data namespace. How do you choose when to use one of these, or an Array for example ?
Thanks in advance
|
|
|
|
|
Open your textbook. I'm sure those answers are readily available, since this sounds like a really easy question on homework.
2 things:
1) Read the sticky at the top, it will help you get answers.
2) To elaborate, had you posted this exact question, but followed it with what you thought the answer was, and what you were having problems conceptualizing (Like trying to come up with situations when you would use one data collection object or another, with examples), I'm sure you probably would have gotten a few answers to try and help you understand things better. I (and I'm not sure I speak for everyone, but I definetely speak for myself) am glad to help to people who it seems have put work into their efforts so far.
|
|
|
|
|
I can perfectly call a new web page from a Hyperlink control inside a DataList control and pass two values to it by using this code:
___________________________________________________________
...
<asp:DataList ID="promotionlist" Runat="server" >
<ItemTemplate>
.
.
.
<asp:HyperLink ID="HyperLink1" Runat="server" NavigateUrl='<%# "../NewWebPage.aspx?Title=" + Eval("Title") + "&Price=" + Eval("Price") %>'>
<img width="74" height="24" src="Images/newwebpage.gif" border="0"/>
</asp:HyperLink>
.
.
.
</ItemTemplate>
</asp:DataList>
...
___________________________________________________________
But the problem with that is that it replaces the current web page ( web form ) which defeats my purpose.
I need the new page to appear in a (((pop-up window ))) and also receive the values “Title” and “Price” that are received through the “Eval()” function.
I did not find any C# function like the javascript one ( window.open()) so I tried an inline javascript code with inline C# insertions but it does not work.
I am not sure if the culprit is the syntax or it is impossible to concatenate strings in inline javascript with values obtained by inline C# code like (<%#Eval("Title") %>).
I would be grateful to whom could suggest a simple and elegant solution or correct the syntax of my code.
Here is my current tentative code ( it does not work ):
__________________________________________________________
…
<a href='' onclick = "window.open('NewWebPage.aspx?Title='+<%# Eval("Title") %>+'&Price='+<%# Eval("Price")%>)">
<img width="74" height="24" src="Images/newwebpage.gif" border="0"/>
</a>
..
___________________________________________________________
|
|
|
|
|
Can you open the window through normal Javascript, and put the values for title and price in Session.
Sincerely,
Elina
Life is great!!!
Enjoy every moment of it!
|
|
|
|
|
Hi Elina. Good to know people who loves life. Yes, life is wonderful !
Could you tell me, using some code example, how to put values in the Session from a DataList and how to retrieve them inside a pop-up window ?
|
|
|
|
|
Hi tedhill,
(Should I add the number ? )
Here is how you put the value to the Session:
Session[indexName] = yourValue;
Now retrieve it:
yourRetrievedValue= (YourValueType)Session[indexname] .
indexName is any string you choose.
Good Luck,
Elina
Life is great!!!
Enjoy every moment of it!
|
|
|
|
|
Thank you, Elina.
I will try it !
|
|
|
|
|
Good luck,
Let me know, if you will have problems.
Will be happy to help, if I will be able, of course
Sincerely,
Elina
Life is great!!!
Enjoy every moment of it!
|
|
|
|
|
I drew some shape that i would like it to appear on the top of the tab control. Right it's just draw on to the form "behind" the tab. how should i do that?
thanks
Donkaiser
|
|
|
|
|
solved by using paint event of the tab.
Donkaiser
|
|
|
|
|
Hi all,
I'm trying to do some managed directshow stuff and i'm a bit stuck on some Bitmap things.
I'm trying to make a Bitmap in a callback where I am presented with an IntPtr to a block of unmanaged memory which contains my pixel data.
I can create the bitmap just fine with one of the Bitmap constructor overloads:-
Bitmap b = new Bitmap(
720,
576,
-2160,
PixelFormat.Format24bppRgb,
(IntPtr)(ip.ToInt32() + 1244160 - 2160)
);
(stride and the IntPtr itself are hacked around a bit because my pixel data scans left-right,bottom-top. but that's not important right now).
When i've done this, I can create and use the bitmap. However, the Bitmap does not copy the data, and as such when I free the memory for the bitmap data (I have to do this - this is unsafe code), the bitmap is corrupt.
Edit: i've also tried the Bitmap.Clone() method- but the new bitmap still references the unmanaged data.
So, i've been looking for a way of copying the pixel data into a managed type so that i can keep a reference to it for as long as I need it, and then let the GC free it. But i'm struggling on how to do this.
I can easily copy the data to a byte[] array (with Marshal.Copy), but then how can I create a bitmap from the byte array?
Or can anyone else see an alternative way of doing this?
thanks
Jon
using System.Beer;
-- modified at 9:18 Thursday 15th June, 2006
|
|
|
|
|
If you create a new blank Bitmap, you can use LockBits to pin the bitmap data and get a pointer to it. Could you use that with Marshal.Copy to copy the unmanaged data into the bitmap?
---
b { font-weight: normal; }
|
|
|
|
|
Guffa wrote: If you create a new blank Bitmap, you can use LockBits to pin the bitmap data and get a pointer to it. Could you use that with Marshal.Copy to copy the unmanaged data into the bitmap?
Ups, seems that my reply notification didn't worked...
Meanwhile it seems to work using an IntPtr for initialising, but as far as I can see, the new instance allocates also memory, which is completetly unnecessary because the bitmap data are already in an unmanaged buffer, where the IntPtr points to. My initial idea was to avoid any copying issues for performance reasons and just define the bitmap format and set the pointer directly to the image data. This seems to be a lot more complicated used the managed environment. I'm not sure if it would work if the IntPtr would point to a managed location.
Any suggestions are welcome.
Bye,
Florian
|
|
|
|
|
I am developing some applications with VS 2005. In a datagridview I have added a checkbox column which, at times, I would like to be able to programatically check or uncheck. Unfortunately, whether I have that column bound to a data source or not I can not seem to programatically check or uncheck the column by changing the value to True or False (TrueValue is set to True, FalseValue is set to False). If I bind the column to a datasource that is False, the column shows as unchecked, and then I can not programatically check it and vice versa. Physically checking or unchecking via mouse clicks works fine. Can anyone tell me what I must do to programatically check or uncheck a bound or unbound checkbox column in a datagridview?
Thank you.
|
|
|
|
|
Update to my question. I figured out that if I move to another column in the grid, after programatically updating the grid, the check-box does change as I expected. For some reason it does not change immediately. Still very peculiar and I'm beginning to think it may be related to an override of ProcessCmdKey that I have in this application.
|
|
|
|
|
Hello all,
In my Winform i am using webBrowser control. in this i am displaying the asp.net page. it is working fine.
but I want to get the Page Title using webBrowser control. How to get this?
any sounds
regards
GV Ramana
regards
GV Ramana
|
|
|
|
|
Hello,
I'm not sure if you're using the new WebBrowser control class in .NET 2.0 or whether you are using AxWebBrowser with .NET earlier than 2.0. I'll give what I think is the solution for both of these:
For the WebBrowser class in .NET 2.0:
WebBrowser myBrowser;
...
HtmlDocument myDocument = myBrowser.Document;
String myTitle = myDocument.Title; This code in .NET 2.0 will get the value contained between the HTML tags <title> and .
AxWebBrowser control in .NET earlier than 2.0
AxSHDocVw.AxWebBrowser myBrowser;
...
HTMLDocument myDoc = myBrowser.Document;
String myTitle = myDoc.title; This code will do the same as the code above, that is, retrieve the value between the HTML tags <title> and .
Hope that helps! Let me know if that does not solve the problem and I will try to help you as best I can.
Sincerely,
Alexander Wiseman
|
|
|
|
|
Hi, Everyone
i am new to c# can anyone help me how to call a variable in Form2 which is been declared in Form1 .
Thankyou.
Regards,
Praveen
|
|
|
|