rogersb
Forum Replies Created
-
AuthorPosts
-
I was able to add properties to make bullets, but now? each line goes all the way to the left margin when its numbering the text is all set to the new margin thats indented. with bullets the bullets are on the left edge, only the first line is indented, the rest go out to the left margin
No help no info nothing???
Again, take Word. New document. Make a title like “ITEMS”. next line type Item1 then Item2 then Item3.. etc then go back and select all the Items then click on the bullets/numbering, select a bullet, save. go into the power tool and take that block of C# code, put into an MVC controller that generates a word doc.
It comes out as NUMBERS.
why. No solution found changes it, have tried far more than Ive listed. over a full day wasted just trying ways to make the bullet symbols appear.
This abject FAILURE of the OpenXML Word doc system should be written up with some kind of solution provided.
Like buying batteries for something. Brand new, they dont work because you have to now open the new batteries, scrape out the carbon then re-heat the carbon with some other material then spread it back into the battery, then seal and weld them back up. Not too much to ask at all. And nobody knows just how to do this process, so you and your team of scientists spend months of trial and error to accomplish this.
Just like using bullet points here. You cant use them because of some lame, unknown defect that hasnt been documented.
I was able to get around this. When in doubt? recheck the requirements document carefully!
Its interesting to know if such an add in exists, but for now, dont need it
Hi Eric!
nice to talk with you again, you helped me thru a really challenging project before. I created a word doc and added it into c# mvc code and it creates reports, very complex, over 10,000 loc but now have to make another.
I have been making parts of the doc, like a table and spliced that into code, formatting is fine, but something visual like the gantt chart? I had done a bar chart, wow that was difficult to make work right
Created a bar chart and will try it too, maybe its not as hard as I think? was hoping for some add-in. everything else is done like you say. thanks
do I need to use XElement to modify the size of the items? Im looking at the open xml sdk productivity tool 2.5 from the generated item. how do I resize the items
XElement tbl = xDoc.Root.Element(W.body).Elements(W.tbl).FirstOrDefault();
tbl.modifyDescendants(Outline)= new A.Outline(){ Width = 9525, CapType = A.LineCapValues.Flat, CompoundLineType = A.CompoundLineValues.Single, Alignment = A.PenAlignmentValues.Center };
}`
just a guess at how the part-Outline would be modified
what the documentation didnt say was you go into Tools, Nuget, manage packages for solution, add:
openxmlpowertools by Eric White
openxmlsdk-mot by microsoft open technologies
and apparently system.management.automation by microsoft (unofficial and unsupported) these are checked.now it will build
Seriously, what does it take to get an example to run????
I go download the Open-Xml-PowerTools-4-1-3 and extract and try to build the example to follow along with the video, DocumentAssembler01
Im not adding anything, just trying to follow the steps as given. build errors!
1. System.IO.packaging; there is no “packaging” within System.IO
type or namespace name ‘Packaging’ does not exist in the namespace ‘System.IO’. (are you missing an assembly reference?) Using directive is unnecessary.
2. you must add a reference to WindowsBase v4.0.0.0 [this step I did]the video says get the example, then build them, but it doesnt work
The problem happens when trying to modify the bar chart value? when you make a barchart it uses an Excel clip to store the values. If this gets closed? apparently it cannot be re-opened. Its gone.
So I create a new barchart and modify the values from its excel clip. the problem is this create a binary blob representing that data and serializes it into a binary string.
its so incredibly easy to make an Excel file, and it will accept the variables that come right out of the database
but I found out the indexing for the Sort() was 0th based not 1-based, so doing ws.Sort(5) had it sort on column F not column E; and col. F was just Y or N, so looking at the dates being out of order it seemed not to sort, plus its got colored rows that are mixed.
But it has another problem where it sorts good now using ws.Sort(4) gets sorting on col “E”
then it goes back and sorts col. 1 on those values splitting up the row data, which to me seems like its never supposed to do because now the row data is corrupt.
right… so deleting closedXML on nuget and re installing? I took the latest build. could be the problem
- This reply was modified 8 years, 2 months ago by rogersb.
Yes I watched this and other videos, they are very well made and helpful.
I think a better question would be how to modify the chartPart? This was actually your code that I adapted and made work within the needs of the project, its not so much modifying the micro detail thing axis value, but how, in general, can either chartPart or chartData, be modified?
I’ve tried the 100 monkeys chained to 100 typewriters with endless paper, cigarettes and coffee typing randomly approach to try and find any matching code that can change a parameter of chartPart to no avail.
so I have the chartPart, ChartPart chartPart = (ChartPart)mainDoc.GetPartById(chartRid);
can this chartPart be modified in the code, at all?
in the document under /word/charts/chart1.xml <>c:chart(Chart) there is:
<c:barChart> <c:valAx> <c:axId val="422883200" /> <c:scaling> <c:orientation val="minMax" /> <c:max val="1.0001" /> <c:min val="-1.0000000000000003E-4" /> </c:scaling> In the reflected code: ValueAxis valueAxis1 = new ValueAxis(); AxisId axisId4 = new AxisId(){ Val = (UInt32Value)422883200U }; Scaling scaling2 = new Scaling(); Orientation orientation2 = new Orientation(){ Val = OrientationValues.MinMax }; MaxAxisValue maxAxisValue1 = new MaxAxisValue(){ Val = 1.0001D }; MinAxisValue minAxisValue1 = new MinAxisValue(){ Val = -1.0000000000000003E-4D }; scaling2.Append(orientation2); scaling2.Append(maxAxisValue1); scaling2.Append(minAxisValue1); Delete delete2 = new Delete(){ Val = false }; AxisPosition axisPosition2 = new AxisPosition(){ Val = AxisPositionValues.Bottom };
how can this be found within chartPart? I have this elaborate scheme to modify a charts values, but where is scaling found and how can the maxAxisValue1 be appended?
I dont want to have to recreate the entire logic which is currently nearly 20,000 LOC to modify the barchart
Da, Privet I understand you have done training and are practicing with the WinAPI, this is great. What is it specifically you want to do? Its a matter of study then working in software; or if you can improve some software? or make a new one? People might buy it
Its like going to a beach, looking for a specific grain of sand that I cannot really identify too well. Thats how changing the scale of the horiz bar chart has been. But its solved and working now. To anyone else trying to do this? Better you figure it out for yourself perhaps. This is advice to those trying to understand
https://closedxml.codeplex.com/ Seems like to those wanting to find solutions, this is the place to go
-
AuthorPosts