Question
*strong text*I am trying to create and write to excel. For the template, I simply copied over code from OPENXML Productivity tool for an existing excel file, and then modified the code to add my rows of data when a new file is created from that code. However, I seem to be having some issue getting this to work correctly. I keep getting a
ccannot open the file : part /xl/worksheets/sheet2: Root element is missing
Replaced Part: /xl/worksheets/sheet2.xml part with XML error. A document must contain exactly one root element. Line 1, column 0.
error which I am still unable to correctly debug. Also, in the original template, there were 3 sheets in my workbook. I made sure to delete two of them so I can have just the code for the one created, as I assumed the OpenXML 2.0 Productivity tool would only generate code for the sheet that existed at the time document code was put together. But what happens is that the generated file has all 4 of the original sheets in place, but seems to not be able to put together the headers on each.
Wanted to get some hints as to where to go to find this problem and fix it. thanks in advance.
No correct solution
The problem is in the way you are structuring the XML; as the error explains, XMLs must have exactly one root element. Let me give you some examples:
Valid XML document:
Invalid XML document:
If I had to guess — this error is cause by the fact that you removed the
line from the example. Note, I took your code and replaced the 1’s with 2’s..
Where you would look is in the
WorkbookPart workbookPart1 = document.AddWorkbookPart();
GenerateWorkbookPart1Content(workbookPart1);
part. In there is a place where they had multiple sheet generation (not worksheet generation, which is the part you removed)
That id in the Sheet initializer is actually a reference to the ID of the workbook. Since you got rid of the GenerateWorkbookPart2Content function, that reference is an error.
In Microsoft’s example code — they use:
sheet1.Id = workbookPart.GetIdOfPart(worksheetPart1);
Which is still a soft reference, but at least no hard coding.. 😉
when i am planning to redeploy the Cube . I took the latest cube from Production and want to deploy in Dev server . i am getting the fallowing error .
Error 33 XML parsing failed at line 1, column 0: A document must contain exactly one root element. . 0 0
Error 34 Errors in the metadata manager. An error occurred when instantiating a metadata object from the file, ‘\?E:MSSQLDataDbR4.194.dbMSC ID.112677.dim.xml’. 0 0
Solution : Go the path specified the in the Error on the deploying server not on you local server . and there you will find that file with 0 KB . Delete that file and redeploy the project .
Popular posts from this blog
1. Introduction A partition is a container for a portion of the measure group data. Every measure group has at least one partition; this partition is created when the measure group is defined. When you create a new partition for a measure group, the new partition is added to the set of partitions that already exist for the measure group. Partitions are a powerful and flexible means of managing cubes, especially large cubes. Processing a smaller amount of data will improve processing performance by decreasing processing time. It is also very easy to maintain the cube .By default each measuregroup have one Partition but for better processing performance and query performance we need to have multiple partitions based on criteria. The best way to design partition is based on date column. Dynamic Partitioning is an automation of partition creation, deletion, merging and processing etc. Without any manual intervention .it will reduce cost as well as human errors for handling t
A connection cannot be made to redirector. Ensure that ‘SQL Browser’ service is running. (Microsoft. AnalysisServices. AdomdClient). + Solution
При попытке отправки налоговой формы (декларации, отчета) появляется такое сообщение:
Форма налоговой отчетности не подлежит отправке на сервер.. Это сообщение может появляться в ИС ЭФНО, ИСИД, ИС НДС.Проверьте заполнение ключевых полей: РНН, Ф.И.О или наименование налогоплательщика, налоговый период, вид отчетности, код налогового органа, ФИО руководителя (налогоплательщика), Ф.И.О. Главного бухгалтера, ФИО должностного лица, заполнившего налоговую отчетность (декларацию, форму), строки к разноске, режим налогообложения.ФИО должностного лица, заполнившего налоговую отчетность
Возможны еще, в конце другие варианты, например: ФИО руководителя (налогоплательщика), Ф.И.О. Главного бухгалтера, ФИО должностного лица.При этом все в декларации заполнено верно, точно и правильно.Решение данной проблемы такое: открываем ту страничку, где у Вас указано данное должностное лицо, главный бухгалтер, ФИО руководителя (налогоплательщика) и просто стираем это имя и набираем заново.После данной процедуры повторно пытаемся отправить форму.Если форма отправилась, то напишите здесь, Мы за Вас вместе порадуемся, если не отправилась, всё равно пишите, возможно проблема есть в других полях формыВ случае, если сообщение выглядит так:
Форма налоговой отчетности не подлежит отправке на сервер.Проверьте заполнение ключевых полей: РНН, Ф.И.О или наименование налогоплательщика, налоговый период, вид отчетности, код налогового органа, ФИО руководителя (налогоплательщика), Ф.И.О. Главного бухгалтера, ФИО должностного лица, заполнившего налоговую отчетность (декларацию, форму), строки к разноске, режим налогообложения.Хотя бы одна строка у разноске должна быть заполнена
Это означает, что в форме не заполнена одна или несколько строк подлежащих разноске на лицевые счета. Решение: проверьте все поля, в которых идут суммы на разноску на лицевые счета, обычно на основой форме (как правило именно оттуда суммы разносятся в ИНИС). Если Вы где-то подразумевали нули (например, нет оборота), то лучше поставьте нули явно, это не только поможет отправить форму, но и поможет с разноской в будущем.Аналогично, если последняя строка будет другой, нужно внимательно ее перечитать, в ней собственно решение проблемы.Если Ваша проблема не решилась, то пишите, поможем.
Как зарегистрироваться на форуме?
sokref » 09 янв 2009, 16:18
Попробуйте сначала первые два.
Не спрашивайте, что на форуме могут сделать для Вас. Спросите, что Вы можете сделать для других и помощь Вам вернетсяМожете послать СМС, дать ответ на чей-то вопрос, поднять интересную тему или написать наш адрес на своем бедре
Эксперт-КураторСообщения: 9576Зарегистрирован: 26 янв 2008, 20:30Профессия: Компьютерщик (не 1С)Блог имени sokrefАктивность участника
Привет. Мы ищем таланты:
Мы ищем таланты, которые помогут развить форум.
Что взамен:
Как: об этом написано на странице: http://tandem.f2.kz/
Вернуться в ИСИД
Кто сейчас на конференции
Сейчас этот форум просматривают: нет зарегистрированных пользователей и гости: 1